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   660 Views

Avatar
Remat457

Community Member, 2 Posts

30 July 2010 at 11:38am

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

Forum Moderator, 5513 Posts

30 July 2010 at 3:22pm

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

Community Member, 2 Posts

31 July 2010 at 5:40pm

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