藏茗山學(xué)院
安全可靠、性能穩(wěn)定、追求極致的用戶體驗(yàn)
JEECMSv9.x常用功能標(biāo)簽大全
單欄目 [@cms_channel]
欄目對(duì)象標(biāo)簽
[@cms_channel id='1' path=’news’ siteId=’1’]
參數(shù)詳解:
id:欄目ID 若id參數(shù)不為空則另外兩個(gè)參數(shù)無效
path:欄目路徑 ,若id為空則根據(jù)站點(diǎn)id和path來獲取欄目對(duì)象
siteId: 站點(diǎn)ID,存在時(shí)獲取該站點(diǎn)欄目,不存在時(shí)獲取當(dāng)前站點(diǎn)欄目
具體例子:
[@cms_channel id='1']
<ahref="${tag_bean.url}" target="_blank">${tag_bean.name}</a>
[/@cms_channel]
欄目對(duì)象屬性:
參考第二章的欄目對(duì)象可訪問屬性
分頁 [@cms_ pagination]
分頁標(biāo)簽:[@cms_pagination sysPage='1' userPage=’content’/]
參數(shù)詳解:
sysPage:1系統(tǒng)預(yù)定義的分頁模板,優(yōu)先級(jí)大于userPage
userPage :‘content’則獲取模板下 style_page下面的content.html為分頁頁面
單模型 [@cms_model]
模型標(biāo)簽:[@cms_model id=’1’ path=’news’]
參數(shù)詳解:
id:模型id
path:模型路徑 ,兩個(gè)參數(shù)用一個(gè)即可,id優(yōu)先級(jí)高于path
模型對(duì)象屬性
name:評(píng)論內(nèi)容
path:模型路徑
priority:模型排序
disabled:是否禁用
hasContent:是否有內(nèi)容
def:是否默認(rèn)
global:是否全站模型
items:模型字段對(duì)象集合
模型字段對(duì)象屬性
field:字段 label:名稱 priority 排序
defValue:默認(rèn)值 optValue 可選項(xiàng)
datatype:字段類型:1 字符串文本 2整型文本 3浮點(diǎn)型文本 4文本區(qū) 5日期 6下拉列表 7復(fù)選框 8單選框 9附件 10圖片
channel:[#if item.channel]欄目模型字段[#else]內(nèi)容模型字段[/#if]
custom: [#if item. custom]自定義字段[#else]系統(tǒng)默認(rèn)字段[/#if]
display:是否展示
required:是否必填
廣告 [@cms_advertising]
模型標(biāo)簽:[@cms_advertising id=’1]
參數(shù)詳解:
id:廣告id,必選
廣告對(duì)象屬性
percent 轉(zhuǎn)化率=點(diǎn)擊數(shù)/展現(xiàn)數(shù)
name:名稱
category:類型 image、flash、text、code 分別是圖片、flash、文本、代碼類型
code:廣告代碼,在category為code類型時(shí)候 該項(xiàng)有值
weight:權(quán)重
displayCount:展現(xiàn)次數(shù)
clickCount:點(diǎn)擊次數(shù)
startTime:開始時(shí)間
endTime:結(jié)束時(shí)間
enabled:是否禁用
具體例子:
[@cms_advertising id='1']
[#if tag_bean??]
[#if tag_bean.category=="image"]
[#assign html]
<a href="${( tag_bean.attr.image_link)!}" target="${ tag_bean.attr.image_target!}" title="${(tag_bean.attr.image_title)!}">
<img src="${tag_bean.attr.image_url}" border="0"[#if (tag_bean.attr.image_width)??] width="${tag_bean.attr.image_width}"[/#if][#if (tag_bean.attr.image_height)??] height="${tag_bean.attr.image_height}"[/#if]/>
</a>
[/#assign]
${html!}
[#elseif tag_bean.category=="flash"]
[#assign html]
<embed type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" play="true" loop="true" menu="true"
src="${(tag_bean.attr.flash_url)!}"[#if tag_bean.attr.flash_width?? && tag_bean.attr.flash_width!=""] width="${tag_bean.attr.flash_width}"[/#if][#if tag_bean.attr.flash_height?? && tag_bean.attr.flash_height!=""] height="${tag_bean.attr.flash_height}"[/#if]></embed>
[/#assign]
${html!}
[#elseif tag_bean.category=="text"]
[#assign html]
<a href="${(tag_bean.attr.text_link)!}" target="${(tag_bean.attr.text_target)!}">
<span style="[#if (tag_bean.attr.text_color)??]color:${tag_bean.attr.text_color};[/#if][#if (tag_bean.attr.text_font)??]font-size:${tag_bean.attr.text_font};[/#if]">${(tag_bean.attr.text_title)!}</span>
</a>
[/#assign]
${html!}
[#elseif tag_bean.category=="code"]
${tag_bean.code!}
[#else]
未知的廣告類型:${tag_bean.category!}
[/#if]
[#else]
廣告不存在"
[/#if]
[/@cms_advertising]
簡(jiǎn)單的調(diào)用方式
${base}/ad.jspx?id=1 調(diào)用具體某個(gè)廣告
還可以按照廣告版位來調(diào)用廣告,這樣可以實(shí)現(xiàn)按照區(qū)位來展現(xiàn)多個(gè)廣告輪換展示
${base}/adspace.jspx?id=1 調(diào)用廣告版位id為1的廣告,若該區(qū)位有多個(gè)廣告,將按照廣告的權(quán)重來展示,若A廣告權(quán)重2 B廣告權(quán)重1 那么A廣告出現(xiàn)次數(shù)大約是B的2倍
例如:
<script src="${base}/ad.jspx?id=1"></script>