• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Conditionals somehow don't work

CyberAP

Well-known member
#1
I have this code at the very beginning in PAGE_CONTAINER:

Code:
<xen:if is="{$canSearch}">
    <xen:if is="{$controllerName} == 'XenResource_ControllerPublic_Resource'">
        <xen:if is="{$controllerAction} == 'Index'">
            <xen:set var="$hasSearchBar" value="true" />
        <xen:elseif is="{$controllerAction} != 'Index'" />
            <xen:set var="$hasSearchBar" value="false" />
        </xen:if>
    <xen:else />
        <xen:set var="$hasSearchBar" value="true" />
    </xen:if>
</xen:if>
It checks if there should be a serachBar, obviously. But it doesn't work as expected. I always have searchBar even when {$controllerAction} != 'Index'.
What can be causing that? I just tried everything and it doesn't work. I have $hasSearchBar variable in breadcrumb template and it seems to be working but in a wrong way, it always gives 'false'.