Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Template Questions /

Using DataObject item on another page


Reply


2 Posts   965 Views

Avatar
sca123

Community Member, 61 Posts

13 April 2010 at 10:35pm

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

Avatar
sca123

Community Member, 61 Posts

13 April 2010 at 10:58pm

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