21282 Posts in 5730 Topics by 2601 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1254 Views |
-
if ClassName doesn't work with Controller

2 March 2011 at 12:11pm
I have an <% if ClassName = PhotoController %> in my top-level Page.ss template file, to include some js on a certain class. However I'm not using page types, only the controller (PhotoController extends Page_Controller). The if ClassName seems to work only on page types, not the controller. Can anyone shine some light on this?
-
Re: if ClassName doesn't work with Controller

2 March 2011 at 10:17pm
Yes because $ClassName is tied to a SiteTree model (like $Title), you could create a ClassName function on your controller like..
function ClassName() {
return __CLASS__;
}
| 1254 Views | ||
|
Page:
1
|
Go to Top |


