0

兄弟ページの情報をテンプレート ファイルに追加する方法を見つける必要があります

ファイル構造のイメージを次に示します (赤い項目は、テンプレート内でアクセスする必要がある兄弟の情報です)。

ここに画像の説明を入力

私が使用しているtplファイルコードは次のとおりです。

[[+total:isequalto=`1`:then=`<div class="equalHeightListItem full_width[[+idx:isequalto=`1`:then=` column-last`]]">`:else=``]][[+total:isequalto=`2`:then=`<div class="equalHeightListItem one_half[[+idx:isequalto=`2`:then=` column-last`]]">`:else=``]][[+total:isequalto=`3`:then=`<div class="equalHeightListItem one_third[[+idx:isequalto=`3`:then=` column-last`]]">`:else=``]][[+total:isequalto=`4`:then=`<div class="equalHeightListItem one_half[[+idx:isequalto=`2`:then=` column-last`]][[+idx:isequalto=`4`:then=` column-last`]]">`:else=``]]
    <figure class="projectImg bwWrapper icon-box7">
        <a href="[[~[[+id]]]]">
            <div class="operations productImage" style="max-width: 100%; background-image: url('[[+tv.products.category.img]]')"></div>
        </a>
        <div class="projectDesc equalHeightListItemInner operations">
            <h4><a href="[[~[[+id]]]]">[[+menutitle:default=`[[+pagetitle]]`]]</a></h4>
            <p>[[+introtext]]</p>

            <div><a href="[[~[[+id]]]]" class="magicmore corpLink">Read More</a></div>

            <!-- I need to add sibling info here -->

        </div>                
    </figure>
</div>

どんな助けでも大歓迎です。

4

1 に答える 1

3

私はpdoResources(に似てgetResourcesいますが、より高速です)を使用します。代わりにこのコードを配置する<!-- I need to add sibling info here -->と、これが役立ちます。

[[pdoResources?
    &parents=`[[+id]]`
    &depth=`1`
    &tpl=`your_sibling_row_tpl`
]]
于 2016-12-06T19:29:31.173 に答える