Document

 咨询热线

18969909123

微信扫码咨询

收 起 

咨询热线

返回顶部

JEECMSv9.x常用功能标签大全

发布时间: 2018-01-11 18:09:22 作者:本站编辑 来源: 本站原创 浏览次数:1022792

单栏目 [@cms_channel]

栏目对象标签

[@cms_channel id='1'  path=’news’ siteId=’1’]

参数详解:

id:栏目ID 若id参数不为空则另外两个参数无效

path:栏目路径 ,若id为空则根据站点id和path来获取栏目对象

siteId: 站点ID,存在时获取该站点栏目,不存在时获取当前站点栏目

具体例子:

[@cms_channel id='1']

<ahref="${tag_bean.url}" target="_blank">${tag_bean.name}</a>

[/@cms_channel]

栏目对象属性:

参考第二章的栏目对象可访问属性


分页 [@cms_ pagination]

分页标签:[@cms_pagination sysPage='1' userPage=’content’/]

参数详解:

sysPage:1系统预定义的分页模板,优先级大于userPage

userPage :‘content’则获取模板下 style_page下面的content.html为分页页面


单模型 [@cms_model]

模型标签:[@cms_model id=’1’ path=’news’]

参数详解:

id:模型id

path:模型路径 ,两个参数用一个即可,id优先级高于path

模型对象属性

name:评论内容

path:模型路径

priority:模型排序

disabled:是否禁用

hasContent:是否有内容

def:是否默认

global:是否全站模型

items:模型字段对象集合

模型字段对象属性

field:字段  label:名称 priority 排序

defValue:默认值  optValue 可选项

datatype:字段类型:1 字符串文本 2整型文本 3浮点型文本 4文本区 5日期 6下拉列表 7复选框 8单选框 9附件 10图片

channel:[#if item.channel]栏目模型字段[#else]内容模型字段[/#if]

custom: [#if item. custom]自定义字段[#else]系统默认字段[/#if]

display:是否展示

required:是否必填


广告 [@cms_advertising]

模型标签:[@cms_advertising id=’1]

参数详解:

id:广告id,必选

广告对象属性

percent 转化率=点击数/展现数

name:名称

category:类型 image、flash、text、code 分别是图片、flash、文本、代码类型

code:广告代码,在category为code类型时候 该项有值

weight:权重

displayCount:展现次数

clickCount:点击次数

startTime:开始时间

endTime:结束时间

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] 

简单的调用方式

${base}/ad.jspx?id=1   调用具体某个广告

还可以按照广告版位来调用广告,这样可以实现按照区位来展现多个广告轮换展示

${base}/adspace.jspx?id=1 调用广告版位id为1的广告,若该区位有多个广告,将按照广告的权重来展示,若A广告权重2   B广告权重1   那么A广告出现次数大约是B的2倍

例如:

<script src="${base}/ad.jspx?id=1"></script>


6030