Hello,
I'm trying to append a class to the HTML, based on the template name.
For example: If template = index.php add class="pg-home" else if template = news.php add class="pg-news"
At the moment i'm adding it like this:
class="<cms:if k_template_name=='index.php'>pg-home</cms:if> <cms:if k_template_name=='news.php'>pg-news</cms:if>
But wondered if this was the 'right' approach to take? Someone may have a better way, as this method becomes quite hard to read (code wise).
Thanks in advance
I'm trying to append a class to the HTML, based on the template name.
For example: If template = index.php add class="pg-home" else if template = news.php add class="pg-news"
At the moment i'm adding it like this:
class="<cms:if k_template_name=='index.php'>pg-home</cms:if> <cms:if k_template_name=='news.php'>pg-news</cms:if>
But wondered if this was the 'right' approach to take? Someone may have a better way, as this method becomes quite hard to read (code wise).
Thanks in advance
