lundi 3 octobre 2016

Silverstripe Conditionals in Templates

I am trying to modify one of my templates so that a certain include is called on all Page types except for two. The code I am using is

<% if ClassName != BusinessPage || ClassName != BusinessSubPage %>....some code here <% end_if>  

Which doesn't work, on all pages types the code in the if statement is triggered

If I shorten the code to just one page type eg.

<% if ClassName != BusinessPage %>....some code here <% end_if>  

It gives the expected results on the page type. Is there some unexpected issue with using ClassName as a conditional in an if statement that I need to be aware of that would explain my issues?

Aucun commentaire:

Enregistrer un commentaire