主题 : 广告标签 |
级别: 版主
|
6# 发表于:2018-07-27 17:55:51 IP:182.12.*.*
回复第5楼
广告 [@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> |
||
---|---|---|---|
级别: 解元
|
8# 发表于:2023-05-22 12:46:02 IP:49.115.*.*
回复第6楼
首页调用多个广告展示怎么调用? 写这个代码一次根据ID只能调用一个广告?不能同时调用多个广告吗? |
||
---|---|---|---|
1
共1页