XF 2.0 How do I add the xfmedia and xfrm conditionals?

mysimsek

Active member
hello i am writing addon for xenforo 2 I need some conditions How can I add condition for source manager and media?
 
So I suppose you need a template condition, not PHP Code? I don't know if there's a template condition for this.

Would help a lot if you would describe exactly what you want to do!
 
It worked like this, man.Thank you.


PHP:
    <xf:if is="is_addon_active('XFMG')">
        <xf:if is="$xf.visitor.canAddMedia()">
            <xf:button href="{{ link('media/add') }}" class="button--cta" icon="add" data-xf-click="overlay">
                {{ phrase('xfmg_add_media...') }}
            </xf:button>
        </xf:if>
    </xf:if>
    <xf:if is="is_addon_active('XFRM')">
        <xf:if is="$xf.visitor.canAddResource()">
            <xf:button href="{{ link('resources/add') }}" class="button--cta" icon="write" overlay="true">
                {{ phrase('xfrm_add_resource...') }}
            </xf:button>
        </xf:if>
    </xf:if>
 
Back
Top Bottom