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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Archive /

Our old forums are still available as a read-only archive.

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

Blog Entry on Homepage

Go to End

3 Posts   1746 Views


43 Posts

28 May 2008 at 8:50am


Does anyone know how to make the most recent entry from the blog module display on the homepage. I had done this with the new section before, but can't seem to figure out how to do it with the blog. Any ideas?



Forum Moderator, 922 Posts

28 May 2008 at 10:01am

Edited: 28/05/2008 10:01am

Adding this function to your HomePage_Controller should work...

function getLatestPost() {
   return DataObject::get_one('BlogEntry', '', false, 'LastEdited DESC');

Then you can call $LatestPost.Title and so forth in the template.


43 Posts

28 May 2008 at 10:43am

Edited: 28/05/2008 10:43am

Worked. Right on! Thanks, man :)