-
-
Notifications
You must be signed in to change notification settings - Fork 809
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Related content only accesible if published #3303
Comments
Hey, The idea is that by default only published content is fetched. Would it not be simpler to just set the ones you're making the 'related' to as 'published' as well? Your solution would allow you to get them, but you still couldn't link to them. If you just need the information on that page, why not make the related items just 'published'? (i took the liberty of adding some formatting to your issue, for readability ;-) ) |
Hi! Maybe I did not explain myself so well... ;-) Imagine that situation (a real one, I am working on, so we can have an e-commerce extension): By means of some "forms" (frontend-based), you get information about an order. However, in a control panel (frontend-based) I designed, so customers can access and check their orders (related content), you need to list all orders (held and published). Sometimes, you need to show not published records in front-end.. extensions scope is infinite ;-) Comments welcomed... Thanks! |
Bob... Just an offtopic... In Content.php, line 412..417:
It seems that the first slash has to be removed... Dumping $this->app['paths']['rootpath'] shows that it has the ending slash by its own. Thanks |
I've made a PR for this..
That's a good usecase. I'm going to make it slightly different though.. I don't like too many parameters, so i'd like to make it work like this:
That way you can do |
Allow filtering in 'record.related' on other fields too. Fixes #3303
Hi,
I know that using bolt's backend, you can not assign a related content to a contenttype if it is not published, but, using extensions you can.
Problem arrises when you try to get that kind of related content by means of extensions.
Using the
.related(...)
method, if related content is, for example,"held"
, you are not able to get it..related(...)
does not have any parameter to bypass status.However, for example,
getContent(...)
from storage class has it...Just with a small modification, we can get the best of both worlds...
In Content.php, locate the 'related' function:
and replace it with:
(
null
as default guarantees that it does not break anything...)A few lines below there is this sentence:
Jut add, below, these ones:
Now you can use mycontent.related('myrelated', null, '!'), so it bypass the status of the related content.
Obviously, you can filter using a specific status.
Sorry guys, for posting that information this way and do not to generate a pull request or similar.
That's because I do not master github yet and I do not want to break things... so.. if somebody thinks it's interesting and generates that pull request for me.. I promise a beer as reward!.
Thanks.
miguelav
The text was updated successfully, but these errors were encountered: