21279 Posts in 5729 Topics by 2600 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 872 Views |
-
Multiply News Holders

17 September 2010 at 8:46pm Last edited: 20 September 2010 8:07pm
I need to create multiply news sections in to my site.
Is it possible to re-use the news holder only to display the news under that section?
Currently both of my newsholders are displaying all the news article from the whole site.I haven't been able to find any answer from this forum.
I am using Silverstripe 2.3.5. Any piece of code would be much appriciated. Thanks for all help.
-
Re: Multiply News Holders

19 September 2010 at 2:02pm Last edited: 20 September 2010 8:07pm
Yes its possible. Are you talking about the NewsHolders from the tutorial? In that case it should already be doing that. <% control Children %> will return just the children of the current news holder. If you have a custom call like DataObject::get("NewsArticle"); then you will need to filter that by ParentID.
Could you post your current newsholder code?
-
Re: Multiply News Holders

22 September 2010 at 9:22pm
Thanks for your help..
I wasn't controlling the children. I got it working by adding that. -
Re: Multiply News Holders

8 October 2010 at 11:52pm
I have a similar problem, except on my site I have a structure like;
NewsHolder > NewsHolder > Articles (displays nothing)
NewsHolder > Articles (works fine)
I can't get the Grandparent NewsHolder to display the GrandChildren Articles. Infact I can only get a blank white screen.
Anyone have this similar layout?
-
Re: Multiply News Holders

9 October 2010 at 3:05am
this should help: http://doc.silverstripe.org/datamodel#querying_data
| 872 Views | ||
|
Page:
1
|
Go to Top |




