Items This Page

xF2 Eklenti Items This Page 1.1.1

indirmek için izniniz yok
Uyumlu XF Sürümleri
  1. 2.2.X
  2. 2.3.X
Eklenti, sayfada kaç tane gönderi, medya, kaynak vb. gösterileceğini içeren yeni bir şablon ekler.

Description:
This is useful in templates if you want to adjust the display of some element based on how many posts or threads or media items there are displayed. For example, you might want to hide an element from the sidebar on short threads (or on the last page of a thread where only one or two posts are shown), to prevent the sidebar from being much longer than the content.

Usage example:
The following code might be used in a sidebar ad placement to hide the advert on short thread pages.

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'
               ]) && $xf.itemsThisPage <= 1">
        <!-- show nothing -->
    <xf:else />
        <!-- show the item -->
    </xf:if>

An even easier way:
If we combine this addon with the Template Parent addon, which gives us a shorthand way of referencing all of the various thread and forum types in template names using a new $xf.reply.templateParent template variable - we can simplify the above example even further:

HTML:
    <xf:if is="$xf.reply.templateParent == 'thread_view' && $xf.itemsThisPage <= 1">
        <!-- show nothing -->
    <xf:else />
        <!-- show the item -->
    </xf:if>

Hiding ads when there is no content
I use the following code on PropertyChat to hide adverts when there is no content on the page:

HTML:
<xf:if is="$xf.itemsThisPage === 0">
    <!-- show nothing -->
<xf:else />
    <!-- show the item -->
</xf:if>

Benzer kaynaklar

Custom 404 Page by Siropu TRXFTR
404 hata sayfanızı özelleştirin, eksik URL'leri takip edin ve bunları yeni sayfalara yönlendirin.
Home Page Title TRXFTR
Eklenti, anasayfa için boardTitle yerine özel bir başlık belirlemenize olanak tanır.
Remove page action buttons TRXFTR
Bu eklenti, çeşitli sayfalardaki yeni gönderiler ve konu başlığı butonlarını kaldırır.
[cXF] Facebook Page Widget TRXFTR
Bazı ekstra özelliklere sahip Facebook sayfası eklentisini widget olarak ekleyin.
[cXF] Hide profile page TRXFTR
Kullanıcı grubu iznine göre profil sayfasını bir bildirimle gizleyin.
Geri
Üst