• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Only execute callback2 if callback1 doesn't return content?


Well-known member
Addon2 should only be executed if Addon1 does not output content. How could I do that with Template Modification Replace:
<xen:include template="ad_forum_view_above_thread_list" />
with execution order 10
<xen:callback class="Addon1_Callback_ForumView" method="getForumView"
params="{$forum}" />
with execution order 20
<xen:callback class="Addon2_Callback_ForumView" method="getForumView"
params="{$forum}" />
How can I do that? Is that possible with hasContent or xen:set?
Last edited:


Well-known member
I know this is not what you want to hear, and it's slightly off topic, but you do realize that by using the Template Modification system your mod won't work with any custom templates that someone might create don't you?

In this case, IMHO you're better off using a listener and adding your info to the contents of the template. That way so long as any custom template includes the ad_forum_view_above_thread_list template your mod will work with that custom template.


Well-known member
The $0 takes care the template is still there.

Does anyone know how to solve that problem? I thought of returning xen:set $addon1output=1 but it will be parsed only after the second addon is executed.

Chris D

XenForo developer
Staff member
Something like this, maybe:

<xen:set var="$addOn1">
    <xen:callback class="Addon1_Callback_ForumView" method="getForumView" params="{$forum}" />

{xen:raw $addOn1}

<xen:if is="{$addOn1}">
    <xen:callback class="Addon2_Callback_ForumView" method="getForumView" params="{$forum}" />