• هاست سان
  • با خرید اشتراک ویژه شما میتوانید جدیدترین آپدیت افزونه ها و قالب های زیبا و پرکاربرد زنفورو را دریافت کنید!

    هر ماه یک کد تخفیف 60 درصدی محصولات فروشگاه به کاربران منتخب بخش ویژه اهدا می‌شود

Template Parent

افزونه 2 Template Parent 1.0.0

دسترسی دریافت را ندارید
Template Parent
نمای کلی منبع
گروه بندی کردن متغیر الگو $xf.reply.templateParent در همه الگوهای thread_view * و forum_view *
King توسط King Stable
1.0.0 نسخه
0 دریافت‌ها
302 بازدیدها
— رتبه‌بندی
اولین انتشار
آخرین بروزرسانی
سازگاری
توسط نویسنده مشخص نشده است
توسعه‌دهنده
King
King
تاریخ عضویت: ارسالی‌ها: 1,521 واکنش‌ها: 1,808
پشتیبانی از نسخه های
  1. 2.2
نیاز به ویرایش مجوزهای گروه‌های کاربری
  1. نیست
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>
  • لایک
واکنش‌ها[ی پسندها]: Dariush
نویسنده
King
دریافت‌ها
0
بازدیدها
302
اولین انتشار
آخرین بروزرسانی

رتبه‌بندی‌ها

0.00 ستاره 0 رتبه‌بندی

فایل‌های بیشتری از King

عقب
بالا