dede:productimagelist標簽增加autoindex遞增建站問題
導讀:建站問題建站問題我們在開發 織 夢模板 時,如果用到dede:productimagelist標簽發現沒有autoindex自動索引,使用[field:global.autoi網站seo優化營銷型網站建設。
我們在開發 織 夢模板 時,如果用到dede:productimagelist標簽發現沒有autoindex自動索引,使用[field:global.autoindex/]無法調用。島主二次開發了一下,讓dede:productimagelist標簽支持autoindex。 1:打開/include/taglib/productimagelist.lib.php 找到 […]
我們在開發織夢模板時,如果用到dede:productimagelist標簽發現沒有autoindex自動索引,使用[field:global.autoindex/]無法調用。島主二次開發了一下,讓dede:productimagelist標簽支持autoindex。
1:打開/include/taglib/productimagelist.lib.php 找到:
foreach($images as $row)
在其上面增加如下代碼
$GLOBALS['autoindex'] = 1;
//如果您希望autoindex 的起始值從0開始,把1修改成0即可。
繼續找到如下代碼:
$revalue .= $ctp->GetResult();
在其下面增加:
$GLOBALS['autoindex']++;
完成。 2:標簽調用:
{dede:productimagelist}&nb建設網站sp;
<span id="[field:global name=autoindex/]"><img src="[field:imgsrc/]" /></span>
{/dede:productimagelist} 產生的結果:
<span id="0"><img src="1.jpg" /></span>
<span id="1"><img src="2.jpg" /></s個業網站建設公司pan>
<span id="2"><img src="3.jpg" /></span>
或者使用:
{dede:productimagelist}
<div class="item [field:global runphp='yes' name=autoindex](@me < 2)?@me="active":@me="";[/field:global]"> <img src="[field:imgsrc/]"/> </div>
{/dede:productimagelist} 產生的結果:
<div class="item active"> <img src="/1.jpg"/> </div> <div cl網站建設教程ass="item "> <img src="/2.jpg"/> </div> <div class="item "> <img src="/3.jpg"/> </div>聲明: 本文由我的SEOUC技術文章主頁發布于:2023-05-26 ,文章dede:productimagelist標簽增加autoindex遞增建站問題主要講述標簽,標題,dede:productimagelist標簽增網站建設源碼以及服務器配置搭建相關技術文章。轉載請保留鏈接: http://www.bifwcx.com/article/web_9841.html
