dede:field name='imgurls' alt='圖片輸出區(qū)'}<div class="遞增">[field:imgsrc/]</div>{/dede:field}
下面結(jié)果:
<div>/xxx/xxx.jpg</div>
<div>/xxx/xxx.jpg</div>
<div>/xxx/xxx.jpg</div>
<div>/xxx/xxx.jpg</div>
<div>/xxx/xxx.jpg</div>
這個(gè)遞增的標(biāo)簽是什么?
我在網(wǎng)站搜索了下沒(méi)有這個(gè)教程。 [field:global.autoindex/] 和其他遞增標(biāo)簽沒(méi)有作用。
以上是發(fā)布在織夢(mèng)官方論壇的問(wèn)題求解,我也稍微測(cè)試了一下,在這個(gè)標(biāo)簽內(nèi)確實(shí)無(wú)法應(yīng)用[field:global.autoindex/] ,找到相關(guān)的文件看了一下,以設(shè)置了默認(rèn)的$GLOBAL['photoid'] = 0;不過(guò)即使用這個(gè) [field:global.photoid/] 也是不行的。
首先這個(gè){dede:field name='imgurls' alt='圖片輸出區(qū)'}標(biāo)簽必須在發(fā)布圖集的時(shí)候選擇單頁(yè)多圖樣式,才能夠輸出所設(shè)置的圖片數(shù)。其實(shí)這個(gè)標(biāo)簽還不如下面這個(gè)標(biāo)簽?zāi)兀贿^(guò)productimagelist也不支持自增函數(shù),但是也可以通過(guò)修改實(shí)現(xiàn)。
{dede:productimagelist}
<a href="[field:imgsrc/]" title="[field:text/]"><img src="[field:imgsrc/]" /></a>
{/dede:productimagelist}
不過(guò)既然提出了imgurls標(biāo)簽的這個(gè)問(wèn)題,自然也是有解決辦法的。
打開(kāi) include/taglib/channel/img.lib.php,找到,
$fields['text'] = str_replace("'","",$ctag->GetAtt('text'));
$fields['title'] = $title;
$fields['imgsrc'] = trim($ctag->GetInnerText());
$fields['imgsrctrue'] = $fields['imgsrc'];
在其下添加,
$fields['photoid'] = $GLOBAL['photoid']+1;
調(diào)用代碼: [field:global.photoid/]




















