主题 : [@cms_channel_list parentId=channel.parent.id count='10' tpl='0'] 读取子栏目这样写为什么会报错
级别: 举人
UID: 54179
积分:172 加为好友
威望: 20 精华: 0
主题:27 回复:110
注册时间:2013-11-04
在线时长:0
1#   发表于:2015-01-22 09:37:11  IP:124.194.*.*

[@cms_channel_list parentId=channel.parent.id count='10' tpl='0'] 读取子栏目这样写为什么会报错

2015-1-22 9:31:45 org.apache.catalina.core.StandardWrapperValve invoke
严重: 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:
==> channel.parent  [in template "WEB-INF/t/cms/www/default/channel/serve.html" at line 86, column 69]

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:
==> @cms_channel_list parentId=channel.pa...  [in template "WEB-INF/t/cms/www/default/channel/serve.html" at line 86, column 41]] with root cause
FreeMarker template error:
The following has evaluated to null or missing:
==> channel.parent  [in template "WEB-INF/t/cms/www/default/channel/serve.html" at line 86, column 69]

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 (FTL stack trace):
----------
==> @cms_channel_list parentId=channel.pa...  [in template "WEB-INF/t/cms/www/default/channel/serve.html" at line 86, column 41]
----------

Java stack trace (for programmers):
----------
级别: 版主
UID: 70293
积分:78391 加为好友
威望: 1 精华: 0
主题:7 回复:68397
注册时间:2014-12-03
在线时长:0
2#   发表于:2015-01-22 09:39:59  IP:182.204.*.*
parentId=channel.parent.id,你不谢这个参数就是获取顶级栏目,你要获取子栏目就要写子栏目id
1
级别: 举人
UID: 54179
积分:172 加为好友
威望: 20 精华: 0
主题:27 回复:110
注册时间:2013-11-04
在线时长:0
3#   发表于:2015-01-22 10:35:51  IP:124.194.*.*
我要把这个栏目下的所有子栏目都获取
级别: 版主
UID: 70293
积分:78391 加为好友
威望: 1 精华: 0
主题:7 回复:68397
注册时间:2014-12-03
在线时长:0
4#   发表于:2015-01-22 10:39:42  IP:111.79.*.*
不可以的,默认只能取一个
1
1 共1页