XF 2.1 Display page jump buttons on a per usergroup basis?

Amin Sabet

Well-known member
Can anyone advise me how to show or hide page jump buttons on a per usergroup basis?

They overlap with my ads, so I only want to show them to my ad free usergroups.

Thanks,
Amin

jump.webp
 
Can anyone advise me how to show or hide page jump buttons on a per usergroup basis?
I'm not aware of any addon which will achieve this but the page jump buttons code is in the PAGE_CONTAINER template. You could just wrap it an appropriate conditional statement so it only shows to the required usergroups

Code:
<xf:if is="property('scrollJumpButtons')">
    <div class="u-scrollButtons js-scrollButtons" data-trigger-type="{{ property('scrollJumpButtons') }}">
        <xf:button href="#top" class="button--scroll" data-xf-click="scroll-to"><xf:fa icon="fa-arrow-up" /><span class="u-srOnly">{{ phrase('top') }}</span></xf:button>
        <xf:if is="property('scrollJumpButtons') != 'up'">
            <xf:button href="#footer" class="button--scroll" data-xf-click="scroll-to"><xf:fa icon="fa-arrow-down" /><span class="u-srOnly">{{ phrase('bottom') }}</span></xf:button>
        </xf:if>
    </div>
</xf:if>
 
I'm not aware of any addon which will achieve this but the page jump buttons code is in the PAGE_CONTAINER template. You could just wrap it an appropriate conditional statement so it only shows to the required usergroups

Code:
<xf:if is="property('scrollJumpButtons')">
    <div class="u-scrollButtons js-scrollButtons" data-trigger-type="{{ property('scrollJumpButtons') }}">
        <xf:button href="#top" class="button--scroll" data-xf-click="scroll-to"><xf:fa icon="fa-arrow-up" /><span class="u-srOnly">{{ phrase('top') }}</span></xf:button>
        <xf:if is="property('scrollJumpButtons') != 'up'">
            <xf:button href="#footer" class="button--scroll" data-xf-click="scroll-to"><xf:fa icon="fa-arrow-down" /><span class="u-srOnly">{{ phrase('bottom') }}</span></xf:button>
        </xf:if>
    </div>
</xf:if>

Thank you very much!
 
Back
Top Bottom