Template Parent

Template Parent 1.0.1

No permission to download
XF Compatibility
  1. 2.3.x
  2. 2.2.x
Short Description
Download and Discuss Premium, BusinessTemplate Parent 1.0.1 version on Premium Content Best Download Discussion Community. It is zip Extention type and 11.6 KB File size. From Template Parent have 29 Views.
Adds a new template variable $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_article
  • thread_view_type_poll
  • thread_view_type_question
  • thread_view_type_suggestion
  • forum_view_type_article
  • forum_view_type_question
  • forum_view_type_suggestion
So now when you want to target a template conditional to a thread view page (for example, in an advert), instead of previously doing the following:
HTML:
<xf:if is="$xf.reply.template == 'thread_view'">
    <!-- do something -->
</xf:if>


... we must now do this:

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>

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:
HTML:
<xf:if is="$xf.reply.templateParent == 'thread_view'">
    <!-- do something for any thread view pages -->
</xf:if>
... or:
HTML:
<xf:if is="$xf.reply.templateParent == 'forum_view'">
    <!-- do something for any forum view pages -->
</xf:if>

Note that v1.0.1 or higher is required for XF 2.3 compatibility.
Author
axtona
Views
29
Extention type
zip
File size
11.6 KB
First release
Last update
Ratings 0.00 star(s) 0 ratings
Link was Broken? Please  Send Message to NP Team with direct message, You will get it very quickly!
Support Developer If you are satisfied with your test or project have earn money successfully, Maybe you can click more information button to support with buying.

More resources from axtona

Separate Sticky and Normal Threads (XF +2.x) by Xon A
A template modification to separate Sticky and Normal threads.
[MMO] Export/Import TMS A
Small addon for importing/exporting your custom TMS.
[MMO] Allow Template Modification A
As you know, the developers decided to take the opportunity in 2.1.8
Top