1770 Posts in 495 Topics by 531 members
Blog Module
SilverStripe Forums » Blog Module » blog titles
Discuss the Blog Module.
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 522 Views |
-
blog titles

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 -
Re: blog titles

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.
-
Re: blog titles

31 July 2010 at 5:40pm
That worked perfectly! Thanks for the help, and I will check out the tutorial.
| 522 Views | ||
|
Page:
1
|
Go to Top |


