Темплейт Пэрент

Темплейт Пэрент 1.0.1

No permission to download
XF Compatibility
  1. 2.3.x
  2. 2.2.x
Добавляет новую переменную шаблона $xf.reply.templateParent, которая группирует все шаблоны thread_view* и forum_view* вместе.

XenForo 2.2 добавляет множество вариаций к шаблонам thread_view и forum_view для различных новых типов тем.
  • thread_view_type_artikel
  • thread_view_type_poll
  • thread_view_type_question
  • thread_view_type_suggestion[]*forum_view_type_article[]]*forum_view_type_question[]*forum_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>
Еasier способЭтот плагин добавляет новую переменную шаблона, которую мы можем использовать для проверки, является ли шаблон "родителем" видом ветки или видом форума, так что мы можем сделать следующее, чтобыtargetить все шаблоны того типа:
HTML:
<xf:if is="$xf.reply.templateParent == 'thread_view'">
    <!-- do something for any thread view pages -->
</xf:if>
... или:
HTML:
<xf:if is="$xf.reply.templateParent == 'forum_view'">
    <!-- do something for any forum view pages -->
</xf:if>
Примечание: требуется версия v1.0.1 или выше для совместимости с XF 2.3.
Author
axtona
Views
234
Extension type
zip
File size
11.6 KB
First release
Last update
Ratings 0.00 star(s) 0 ratings
More resources from axtona
Using Composer Packages
Using Composer Packages
XenForo v2 uses Composer behind the scenes to include certain packages used by the core software
Eggy SEO Autopilot
Eggy SEO Autopilot
Automated auditing, metadata, structured data, Google Search Console, IndexNow
Cool Timeline Pro - WordPress Timeline Plugin
Cool Timeline Pro - WordPress Timeline Plugin
an advanced WordPress timeline plugin that showcases your life history timeline
Back
Top