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.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

All other Modules /

Discuss all other Modules here.

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

subsite specific template methods

Go to End

2 Posts   1011 Views


Community Member, 545 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



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.