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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Template Questions /

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

Need Help on Where to Post the Code for Recent Updates


Go to End


2 Posts   1467 Views

Avatar
ginger

Community Member, 9 Posts

24 August 2009 at 4:31pm

I want to have the latest modified subpages show up on the parents pages and I saw this code in another similar question in the forum:

function LatestUpdates() {
$parent = DataObject::get_one("Page", "Title = 'Title of the Page');
return DataObject::get("Page", "ParentID = $parent->ID", LastEdited DESC", "",10);
}

My question is, where do I paste this? Into page.ss? And what code should I add to the template to get it to appear?

Thanks for any help!

Avatar
mschiefmaker

Community Member, 187 Posts

11 September 2009 at 6:34pm

Edited: 14/09/2009 1:57pm

Put it in page.php. Checkout out tutorial [url= http://doc.silverstripe.com/doku.php?id=tutorial:2-extending-a-basic-site (latest news section) . This should give you all you need to know

Cheers

MM