Support <xf:pageaction

MrCazper

Registered


In the resources overview, in the above of resources part you can see the add resources button of the Resource Manager add-on
This button can only be seen by people with permissions to add resources.
This is the button code
<xf:pageaction if="$xf.visitor.canAddResource()"> <xf:button href="{{ link('resources/add') }}" class="button--cta" icon="write" overlay="true">{{ phrase('xfrm_add_resource...') }}</xf:button> </xf:pageaction>
I would like to add a button next to the add resource button that normal users can see, ie.
Two buttons together, but one for staffs to see and one for users to see.

Is there a way to make this possible?
I was told was to change the XF:pageaction but I didn't understand how to make it work.
I leave my complete code:
<xf:title page="{$page}">{{ phrase('xfrm_resources') }}</xf:title> <xf:macro template="metadata_macros" name="canonical_url" arg-canonicalUrl="{{ link('canonical:resources', null, {'page': $page > 1 ? $page : null}) }}" /> <xf:page option="searchConstraints" value="{{ { phrase('xfrm_resources'): {'search_type': 'resource'} } }}" /> <xf:pageaction if="$xf.visitor.canAddResource()"> <xf:button href="{{ link('resources/add') }}" class="button--cta" icon="write" overlay="true">{{ phrase('xfrm_add_resource...') }}</xf:button> </xf:pageaction> <xf:widgetpos id="xfrm_overview_above_resources" /> <xf:if is="$canInlineMod"> <xf:js src="xf/inline_mod.js" min="1" /> </xf:if> <div class="block" data-xf-init="{{ $canInlineMod ? 'inline-mod' : '' }}" data-type="resource" data-href="{{ link('inline-mod') }}"> <div class="block-outer"><xf:trim> <xf:pagenav page="{$page}" perpage="{$perPage}" total="{$total}" link="resources" params="{$filters}" wrapperclass="block-outer-main" /> <xf:if contentcheck="true"> <div class="block-outer-opposite"> <div class="buttonGroup"> <xf:contentcheck> <xf:if is="$canInlineMod"> <xf:macro template="inline_mod_macros" name="button" /> </xf:if> </xf:contentcheck> </div> </div> </xf:if> </xf:trim></div> <div class="block-container"> <xf:macro template="xfrm_overview_macros" name="list_filter_bar" arg-filters="{$filters}" arg-baseLinkPath="resources" arg-creatorFilter="{$creatorFilter}" /> <div class="block-body"> <xf:if is="$resources is not empty"> <div class="structItemContainer"> <xf:foreach loop="$resources" value="$resource"> <xf:macro template="xfrm_resource_list_macros" name="resource" arg-filterPrefix="{{ true }}" arg-resource="{$resource}" /> </xf:foreach> </div> <xf:elseif is="$filters" /> <div class="block-row">{{ phrase('xfrm_there_no_resources_matching_your_filters') }}</div> <xf:else /> <div class="block-row">{{ phrase('xfrm_no_resources_have_been_created_yet') }}</div> </xf:if> </div> </div> <div class="block-outer block-outer--after"> <xf:pagenav page="{$page}" perpage="{$perPage}" total="{$total}" link="resources" params="{$filters}" wrapperclass="block-outer-main" /> <xf:showignored wrapperclass="block-outer-opposite" /> </div> </div> <xf:page option="sideNavTitle">{{ phrase('categories') }}</xf:page> <xf:sidenav> <xf:macro template="xfrm_category_list_macros" name="simple_list_block" arg-categoryTree="{$categoryTree}" arg-categoryExtras="{$categoryExtras}" /> </xf:sidenav> <xf:widgetpos id="xfrm_overview_sidenav" position="sidenav" />
 
Back
Top Bottom