Jump to:

10851 Posts in 2517 Topics by 1793 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: 615 Views
  • zenmonkey
    Avatar
    Community Member
    524 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

    Thanks

  • dompie
    Avatar
    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.

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