Jump to:

11003 Posts in 2735 Topics by 1824 members

All other Modules

SilverStripe Forums » All other Modules » subsite specific template methods

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 656 Views
  • zenmonkey
    Community Member
    528 Posts

    subsite specific template methods Link to this post

    I'm just wondering if there are any methods in subsite accessible from the template. I'd like to show slightly different information in my page footer on my subsites than my main site. So an <% if Subsite %> type methods would be ideal


  • dompie
    Community Member
    88 Posts

    Re: subsite specific template methods Link to this post

    I have added add a Method to my Page_Controller as follows:

       public function IsOnSubsite(){
          return is_object(Subsite::currentSubsite())?1:0;

    Some of the Subsite variables/methods you can also access with $Subsite.currentSubsiteID, but I don't know which and how reliable they are.

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.