XF 2.2 How to modify template with html that changes


I need to implement template modification just before login block but the div changes due some other add-on and because of that my modification doesn't work, the div is never found.

<div class="p-navgroup p-account {{ $xf.visitor.user_id ? 'p-navgroup--member' : 'p-navgroup--guest' }}" another-addon-attribute="xxxxxx">

So my question is how to refers (find) a div that changes? I tried using part of the code but it doesn't work either.

<div class="p-navgroup p-account {{ $xf.visitor.user_id ? 'p-navgroup--member' : 'p-navgroup--guest' }}"
Last edited:
Well, just found out what's going on, but the error persists. Another add-on is changing the html, thus interfering on behavior of template modification (simple replacement).

The add-on "top navigation" when active, create another login block on the top, so after compiling the page and inspect into Chrome, I see two login blocks, one from top navigation and other from XF. And when I try to find for login block, it always choose the second one (XF).

Here is how the other add-on is set:

<xf:if is="property('publicNavSticky') == 'primary' && property('tn_sticky') == 'enabled' OR property('publicNavSticky') == 'all' && property('tn_sticky') == 'enabled' OR property('publicNavSticky') == 'none' && property('tn_sticky') == 'enabled'">
    <div class="topNavSticky">
        <xf:include template="cxf_top_navigation" />
<xf:else />
    <xf:include template="cxf_top_navigation" />

So how to configure template modifications to correctly find the login block in this case? Or is there anyway to make template modification happen after this add-on to grab the first one when active?

<div class="p-navgroup p-account {{ $xf.visitor.user_id ? 'p-navgroup--member' : 'p-navgroup--guest' }}">
Last edited:
Top Bottom