- Compatible XF Versions
- 2.2
- Visible Branding
- No
Adds a new template variable
XenForo 2.2 adds multiple variations to the
...we must now do this:
An easier way
This addon adds a new template variable we can use to check if the template "parent" is thread_view or forum_view, so we can simply do the following instead to target all templates of that type:
...or:
$xf.reply.templateParent which groups all thread_view* and forum_view* templates together.XenForo 2.2 adds multiple variations to the
thread_view and forum_view templates for the various new thread types:thread_view_type_articlethread_view_type_pollthread_view_type_questionthread_view_type_suggestionforum_view_type_articleforum_view_type_questionforum_view_type_suggestion
HTML:
<xf:if is="$xf.reply.template == 'thread_view'">
<!-- do something -->
</xf:if>
HTML:
<xf:if is="in_array($xf.reply.template, [
'thread_view',
'thread_view_type_article',
'thread_view_type_poll',
'thread_view_type_question',
'thread_view_type_suggestion'
])">
<!-- do something -->
</xf:if>
This addon adds a new template variable we can use to check if the template "parent" is thread_view or forum_view, so we can simply do the following instead to target all templates of that type:
HTML:
<xf:if is="$xf.reply.templateParent == 'thread_view'">
<!-- do something for any thread view pages -->
</xf:if>
Code:
<xf:if is="$xf.reply.templateParent == 'forum_view'">
<!-- do something for any forum view pages -->
</xf:if>