Conditional statements for url in XenForo templates

If  you need to check a conditional statement in your XenForo template for a specific part of a url just use the following syntax:

<li id="menu-item-14" class="<xen:if is="{$requestPaths.requestUri} == '/community/marketplace/categories/marketplace.7/'"> current-menu-item</xen:if>"><a href="">Marketplace</a></li>

In this example, if the current Url is


the class will be extended with


I use that piece of code to get the current page link in in the main navigation of the XSimulator forum.

Written by

"Enthusiastic Sim-Racer from the north of germany. I write here about web development, hardware, software and latest motion simulator technologies."