Jump to:

23368 Posts in 18143 Topics by 2863 members

General Questions

SilverStripe Forums » General Questions » Multiply News Holders

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1010 Views
  • merme
    Avatar
    Community Member
    2 Posts

    Multiply News Holders Link to this post

    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.

  • Willr
    Avatar
    Forum Moderator
    5489 Posts

    Re: Multiply News Holders Link to this post

    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?

  • merme
    Avatar
    Community Member
    2 Posts

    Re: Multiply News Holders Link to this post

    Thanks for your help..
    I wasn't controlling the children. I got it working by adding that.

  • neilos
    Avatar
    Community Member
    19 Posts

    Re: Multiply News Holders Link to this post

    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?

  • ttyl
    Avatar
    Community Member
    114 Posts
    1010 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.