主题 : @cms_channel_list和@cms_content_list的相关问题
级别: 秀才
UID: 112708
积分:88 加为好友
威望: 2 精华: 0
主题:11 回复:52
注册时间:2017-04-23
在线时长:0
11#   发表于:2017-05-27 17:31:38  IP:180.109.*.*
下周继续请教
级别: 解元
UID: 110327
积分:363 加为好友
威望: 0 精华: 0
主题:0 回复:295
注册时间:2017-02-07
在线时长:0
12#   发表于:2017-05-27 17:31:47  IP:125.83.*.*
过来学习一下
FreeCMS java开源CMS
级别: 版主
UID: 70293
积分:78391 加为好友
威望: 1 精华: 0
主题:7 回复:68397
注册时间:2014-12-03
在线时长:0
13#   发表于:2017-05-31 08:38:32  IP:182.217.*.*
 [@cms_content_list channelId=c.id]   
1
级别: 秀才
UID: 112708
积分:88 加为好友
威望: 2 精华: 0
主题:11 回复:52
注册时间:2017-04-23
在线时长:0
14#   发表于:2017-05-31 09:17:26  IP:180.109.*.*
谢谢,这正是我需要的
级别: 版主
UID: 70293
积分:78391 加为好友
威望: 1 精华: 0
主题:7 回复:68397
注册时间:2014-12-03
在线时长:0
15#   发表于:2017-05-31 09:18:00  IP:182.217.*.*
1
级别: 秀才
UID: 112708
积分:88 加为好友
威望: 2 精华: 0
主题:11 回复:52
注册时间:2017-04-23
在线时长:0
16#   发表于:2017-05-31 10:08:00  IP:180.109.*.*
  [@cms_channel_list parentId=channel.id]  
                             [#list tag_list as c]  
                                       <li class="level1"> <a class="nav-g current" href="${c.url}">${c.name}</a></li>  
                                             <ul class="level2 cur">
                                                     [@cms_content_list channelId=c.id]  
                                                     [#list tag_list as c1]  
                                                          [#if c.id==c1.channel_id] 
                                                                <li><a href="${c1.url}">${c1.title}</a>${c.id}</li>  
                                                          [/#if]   
                                                     [/#list]  
                                                     [/@cms_content_list ] 
                                             </ul>
                             [/#list]  
                             [/@cms_channel_list]  

      [@cms_content_list channelId=c.id]            这个后台报错 The following has evaluated to null or missing:


Servlet.service() for servlet [JeeCmsFront] in context with path [/jeecms] threw exception [Request processing failed; nested exception is freemarker.core.InvalidReferenceException: The following has evaluated to null or missing:
==> c1.channel_id  [in template "WEB-INF/t/cms/www/default/channel/product_menu.html" at line 26, column 70]

----
Tip: It's the step after the last dot that caused this error, not those before it.
----
Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like 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 parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
----

----
FTL stack trace ("~" means nesting-related):
- Failed at: #if c.id == c1.channel_id  [in template "WEB-INF/t/cms/www/default/channel/product_menu.html" at line 26, column 59]
- Reached through: @cms_content_list channelId=c.id  [in template "WEB-INF/t/cms/www/default/channel/product_menu.html" at line 24, column 54]
- Reached through: @cms_channel_list parentId=channel.id  [in template "WEB-INF/t/cms/www/default/channel/product_menu.html" at line 20, column 30]
----] with root cause
FreeMarker template error:
The following has evaluated to null or missing:
==> c1.channel_id  [in template "WEB-INF/t/cms/www/default/channel/product_menu.html" at line 26, column 70]
级别: 版主
UID: 70293
积分:78391 加为好友
威望: 1 精华: 0
主题:7 回复:68397
注册时间:2014-12-03
在线时长:0
17#   发表于:2017-05-31 10:09:58  IP:182.217.*.*
c1.channel_id内容标签没这个参数
1
级别: 版主
UID: 70293
积分:78391 加为好友
威望: 1 精华: 0
主题:7 回复:68397
注册时间:2014-12-03
在线时长:0
18#   发表于:2017-05-31 10:10:00  IP:182.217.*.*
c1.channel_id内容标签没这个参数
1
级别: 秀才
UID: 112708
积分:88 加为好友
威望: 2 精华: 0
主题:11 回复:52
注册时间:2017-04-23
在线时长:0
19#   发表于:2017-05-31 10:12:06  IP:180.109.*.*
这样的不行吗?
级别: 版主
UID: 70293
积分:78391 加为好友
威望: 1 精华: 0
主题:7 回复:68397
注册时间:2014-12-03
在线时长:0
20#   发表于:2017-05-31 10:13:58  IP:182.217.*.*
标签没这个参数,你看后台又没用
1
|< < 1 2 3 > >| 共3页