Jump to:

1842 Posts in 1600 Topics by 558 members

Blog Module

SilverStripe Forums » Blog Module » Create Multiple Custom Blog Holder Templates?

Discuss the Blog Module.

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

Page: 1
Go to End
Author Topic: 664 Views
  • mrmadrone
    Avatar
    Community Member
    2 Posts

    Create Multiple Custom Blog Holder Templates? Link to this post

    I'd like to create multiple custom blog holder templates, so I don't want to necessarily use a modified BlogHolder.ss file that I drop into my theme's /Layout directory.

    Here's what I tried:

    • Creating a Blog Holder called "Superblog" in the CMS.
    • Creating a SuperblogBlogHolder.php file in /code with the following:

      <?php
      class SuperblogBlogHolder extends BlogHolder {
      }
      class SuperblogBlogHolder_Controller extends BlogHolder_Controller {
      }

      ?>

    • Creating SuperblogBlogHolder.ss in /Layout within my theme
    • Dropping BlogHolder.ss in the theme's /templates directory with simply $Layout in the code

    That definitely doesn't work. It loads Superblog, but with no styling or any of the custom stuff I added in the SuperblogBlogHolder.ss file

    If I zap that BlogHolder.ss file from /templates, Superblog loads with all the site's styling, but again none of the custom template code created in the .ss file.

    So either way I'm not getting Superblog to load the custom template code. Am I headed in the right direction here, or am I totally off base? Thanks!

  • IOTI
    Avatar
    Community Member
    189 Posts

    Re: Create Multiple Custom Blog Holder Templates? Link to this post

    Is your "Superblog" page in the CMS page type set to Superblog Blog Holder or Blog Holder?

  • mrmadrone
    Avatar
    Community Member
    2 Posts

    Re: Create Multiple Custom Blog Holder Templates? Link to this post

    Whoops - yep, silly mistake. I also hadn't set a CMS-friendly name in SuperblogBlogHolder.php - it was showing just as Blog Holder in the CMS, so I totally overlooked that it was there as an option.

    Thanks

    664 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.