Jump to:

3447 Posts in 1032 Topics by 872 members

Template Questions

SilverStripe Forums » Template Questions » Using DataObject item on another page

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

Page: 1
Go to End
Author Topic: 902 Views
  • sca123
    Avatar
    Community Member
    61 Posts

    Using DataObject item on another page Link to this post

    Hi
    I am using DataObject for a News area of the site (its a better solution for the design than the blog) - so I have NewsItem.php (that extends the DataObject), NewsPage.php that $has_many NewsItems, and NewsPage.ss that calls all of the news items through <% control NewsItems %>. Each NewsItem has a 'Title' and 'Description' defined.

    This all works great.

    What I now want to do is pull the latest NewsItem from the above DataObject into Page.php.

    Any help would be great
    Thanks

  • sca123
    Avatar
    Community Member
    61 Posts

    Re: Using DataObject item on another page Link to this post

    Its ok, I have resolved this by using <% control.Last %>. Easy when you know how.

    902 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.