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

Archive /

Our old forums are still available as a read-only archive.

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

Page Type control?


Go to End


2 Posts   1594 Views

Avatar
NickJacobs

Community Member, 148 Posts

18 October 2008 at 10:16am

Hi, is there any way of testing for a particular page type? For example, I only want to include certain code on gallery pages .... is there any way of doing something like this:

<% if PageType = GalleryPage %>
....
do something
....
<% end_if %>

Avatar
ajshort

Community Member, 244 Posts

18 October 2008 at 10:38am

Hi galilee,

you can just use something like this in your template:

<% if ClassName = GalleryPage %>