attribute 商品參數(shù)

    [基礎(chǔ)用法]
標(biāo)簽:attribute
描述:商品參數(shù)標(biāo)簽,獲取當(dāng)前商品的參數(shù)列表,僅在產(chǎn)品詳情頁(yè)、列表頁(yè)表用,更多調(diào)用方法見(jiàn)示例。
用法:
    {eyou:attribute type='newattr' attrid='$eyou.field.attrlist_id'}
       {$attr.name}:{$attr.value}
    {/eyou:attribute}
屬性:
    aid='' 文檔ID,在arclist標(biāo)簽、list標(biāo)簽之內(nèi),以及內(nèi)容頁(yè)模板中一般不需要指定aid屬性,系統(tǒng)會(huì)自動(dòng)獲取;
    type='' 標(biāo)簽類型,默認(rèn)是手動(dòng),具體可以參考教程底部的示例;
        ----type='newattr' 新版商城中心的商品參數(shù)
        ----type='auto' 早期產(chǎn)品中心的產(chǎn)品參數(shù);
    empty='' 沒(méi)有數(shù)據(jù)時(shí)顯示的文案
    mod='' 每隔N行輸出的內(nèi)容
    id='' 可以任意指定循環(huán)里的變量名替代field,假設(shè)id='field1',模板調(diào)用如:{$field.title} 變成 {$field1.title}
涉及表字段:
    無(wú)

-------------------------------效果展示--------------------------------
1,在商品內(nèi)容頁(yè)調(diào)用參數(shù)列表,每次新增屬性,不需要更改模板代碼
模板調(diào)用代碼
            {eyou:attribute type='newattr' attrid='$eyou.field.attrlist_id'}
                {$attr.name}:{$attr.value}
            {/eyou:attribute}
網(wǎng)站前端顯示效果(css樣式請(qǐng)自行填充)


2,在商品列表頁(yè)調(diào)用參數(shù)列表,一般嵌套在arclist、list 列表標(biāo)簽里。
模板調(diào)用代碼
{eyou:arclist row='10' id='field'}
      {eyou:attribute type='newattr' attrid='$field.attrlist_id'}
                 {$attr.name}:{$attr.value}
      {/eyou:attribute}{/eyou:arclist}
網(wǎng)站前端顯示效果(css樣式請(qǐng)自行填充)


文檔最后更新時(shí)間:2025-03-21 16:46:06

文檔
目錄

深色
模式

切換
寬度