Jump to:

1835 Posts in 1139 Topics by 554 members

Blog Module

SilverStripe Forums » Blog Module » blog titles

Discuss the Blog Module.

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

Page: 1
Go to End
Author Topic: 602 Views
  • Remat457
    Avatar
    Community Member
    2 Posts

    blog titles Link to this post

    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

  • Willr
    Avatar
    Forum Moderator
    5464 Posts

    Re: blog titles Link to this post

    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.

  • Remat457
    Avatar
    Community Member
    2 Posts

    Re: blog titles Link to this post

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

    602 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.