XF 2.0 How do we stop an overlay ajax form from redirecting after submit?

Hmm, I have this in my template, but it still redirects.

HTML:
<div class="p-navgroup p-account {{ $xf.visitor.user_id ? 'p-navgroup--member' : 'p-navgroup--guest' }}" style="margin-right: 5px;">               
    <a href="{{ link('account/preferences') }}"
        class="p-navgroup-link p-navgroup-link--iconic"
        data-xf-click="overlay"
        data-redirect="off"
        data-xf-init="tooltip" title="{{ phrase('preferences')|for_attr }}" rel="nofollow">
        <i aria-hidden="true"></i>
        <span><xf:fa icon="fa-cogs" /></span>
    </a>
</div>
 
Hmm, I have this in my template, but it still redirects.

HTML:
<div class="p-navgroup p-account {{ $xf.visitor.user_id ? 'p-navgroup--member' : 'p-navgroup--guest' }}" style="margin-right: 5px;">              
    <a href="{{ link('account/preferences') }}"
        class="p-navgroup-link p-navgroup-link--iconic"
        data-xf-click="overlay"
        data-redirect="off"
        data-xf-init="tooltip" title="{{ phrase('preferences')|for_attr }}" rel="nofollow">
        <i aria-hidden="true"></i>
        <span><xf:fa icon="fa-cogs" /></span>
    </a>
</div>

Of course it does, because the overlay is the account_preferences template.

Need another way to do this. 🤔
 
You could probably add data-skip-overlay-redirect="true" to the <xf:form> tag in account_preferences.
 
Back
Top Bottom