Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

All other Modules /

Discuss all other Modules here.

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

subsite specific template methods


Reply


2 Posts   697 Views

Avatar
zenmonkey

Community Member, 532 Posts

11 January 2011 at 7:46am

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

Avatar
dompie

Community Member, 88 Posts

12 January 2011 at 5:33am

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.