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.
Is there a way to check in Page.ss template what page is displayed? or what type of page is displayed, for example HomePage etc.
I'm looking for somethink like <% if Homepage %>
I don't want to change whole template system for one little change on HomePage.
Because this change is in header so I have to do it in main - Page.ss template.
<% if ClassName == HomePage %> $ClassName <% end_if %>
The equality operator in templates is just =, not ==. Therefore it should be:
<% if ClassName = HomePage %> $ClassName <% end_if %>
You can also use this if you're trying to target a particular page:
<% if URLSegment = page-url %>do something here...<% else %>or something else here...<% end_if %>
Thanks for every replay, it looks works fine :)