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?
We've moved the forum!
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
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__;
}