主题 : 点击数获取 有错误 
级别: 进士
UID: 63226
积分:2277 加为好友
威望: 22 精华: 0
主题:261 回复:571
注册时间:2014-06-13
在线时长:0
1#   发表于:2014-10-11 09:42:39  IP:58.72.*.*
我整理了一下代码  



head 以上部分 


内容获取代码 
[@cms_content_list   channelId='72' image='0' orderBy='0'  titLen='20' count='7' new='0' showDesc='0'  target='1' channelOption='1' siteId=site.id  ] 
[#list tag_list as a] 
<li><span class="tb"></span><a href="${a.url}">[@text_cut s=a.title len=titLen /]</a><span class="dj"><a><span id="views"></span></a></span></li> 
[/#list] 
[/@cms_content_list]   

获取方式 <span id="views"></span>


这是全部内容了 不知道那里出错   查看新闻详细页面是正常的 获取方法也正常  但是我用在别的地方就报错 

错误信息 
The following has evaluated to null or missing: ==> content [in template "WEB-INF/t/cms/www/default/index/index.html" at line 29, column 29] Tip: If the failing expression is known to be legally null/missing, either specify a default value with myOptionalVar!myDefault, or use [#if myOptionalVar??]when-present[#else]when-missing[/#if]. (These only cover the last step of the expression; to cover the whole expression, use parenthessis: (myOptionVar.foo)!myDefault, (myOptionVar.foo)?? The failing instruction: ==> ${content.id} [in template "WEB-INF/t/cms/www/default/index/index.html" at line 29, column 27]
级别: 状元
UID: 33380
积分:50625 加为好友
威望: 21 精华: 3
主题:88 回复:30687
注册时间:2012-05-07
在线时长:0
2#   发表于:2014-10-11 10:20:08  IP:182.212.*.*
功成由勤,业精于勤。
级别: 状元
UID: 33380
积分:50625 加为好友
威望: 21 精华: 3
主题:88 回复:30687
注册时间:2012-05-07
在线时长:0
3#   发表于:2014-10-11 10:20:22  IP:182.212.*.*
[@cms_content_list count='10' titLen='12' orderBy='9' channelOption='1' channelId='49']
                    [#list tag_list as a]
                    <li>
                    <div class="v-rank2-order2 v-rank4-top4">${a_index+1}</div>
                    <a href="${a.url}" title="${a.title}" target="_blank">
                    <span>[@text_cut s=a.title len=titLen /]</span>
                    </a>
                    <em>${a.views!}次</em>
                    </li>
                    [/#list]
                    [/@cms_content_list]
功成由勤,业精于勤。
1 共1页