易優cms圖集模型調用多圖時,如何獲取外層的{$i}的值?
2023-04-17
易優cms圖集模型調用多圖時,如何獲取外層的{$i}的值?這個功能只要是用在燈箱彈出圖片效果的時候,將其中的圖集做成一組。
即:
第1篇文章的多圖,都為 gallery_1
第2篇文章的多圖,都為 gallery_2
第3篇文章的多圖,都為 gallery_3
依次類推,如:
代碼如下:
{eyou:artlist} {eyou:assign name='ii' value='$i' /} <--這個是自定義變量 $ii --> {eyou:arcview aid='$field.aid' id='eyoav' addfields='albumpic'} {eyou:diyfield type='imgs' id='albumpic' name='$eyoav.albumpic'} <span data-fancybox="gallery_{$ii}"></span> {/eyou:diyfield} {/eyou:arcview} {/eyou:artlist}