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.

Blog Module

Discuss the Blog Module.

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

blog titles


Reply

3 Posts   644 Views

Avatar
Remat457

30 July 2010 at 11:38am Community Member, 2 Posts

Hi,
Does anybody have a simple way to display a set # (or pages, or all) of the titles in a blog? Like a TOC or index?
thanks

Avatar
Willr

30 July 2010 at 3:22pm Forum Moderator, 5511 Posts

To get a list of pages you should use DataObject::get(). See tutorial 2 for an explanation of DataObject::get(). In your case you can put a function like this in your page.php

function AllBlogPages() {
return DataObject::get('BlogEntry');
}

Then you can use <% control AllBlogPages %>$Title<% end_control %> in your template to get a list of titles.

Avatar
Remat457

31 July 2010 at 5:40pm Community Member, 2 Posts

That worked perfectly! Thanks for the help, and I will check out the tutorial.