XF 2.1 Multiple xf:extension of the same name

Russ

Well-known member
One option in which was used quite often in our styles is essentially shifting the message-attribution bar in the post outside the main post container (to span across the entire message).

Pre-2.2 I simply used a macro along with a conditional to call the macro either in the default position or above the message.

With 2.2, you can't have multiple:

Code:
                            <xf:extension name="attribution">
                                <xf:macro name="post_attribution" arg-post="{$post}" arg-thread="{$thread}" />
                            </xf:extension>
even if it's wrapped in a conditional (at least it's not letting me :D).

Any advice on somehow placing this twice in the template (both being wrapped in a conditional).
 
Solution
Wrap that existing code in your standard conditional. Then, where you want the alternative location to be, do:

Code:
<xf:if is="$otherCondition">
<xf:extensionvalue name="attribution" />
</xf:if>

And that should just work, even in child versions of the template that might manipulate what is within the attribution extension.

Mike

XenForo developer
Staff member
Wrap that existing code in your standard conditional. Then, where you want the alternative location to be, do:

Code:
<xf:if is="$otherCondition">
<xf:extensionvalue name="attribution" />
</xf:if>

And that should just work, even in child versions of the template that might manipulate what is within the attribution extension.
 
Solution

Russ

Well-known member
Wrap that existing code in your standard conditional. Then, where you want the alternative location to be, do:

Code:
<xf:if is="$otherCondition">
<xf:extensionvalue name="attribution" />
</xf:if>

And that should just work, even in child versions of the template that might manipulate what is within the attribution extension.

Thank you Mike! Works perfectly.
 
Top