1、迭代循环
[@NodeList;list] [#list list as node] [#if node.name == "产品试用"] [/#if] [#if node.name == "联系我们"] <li class="l3"><a href="${node.url}">${node.name}</a></li> [/#if] [/#list] [/@NodeList]2、动态包含
[#include "inc_header.html"/]3、内容页获取所属节点的同级节点列表的方法
[@NodeList parentId=info.node.parent.id;list] [#list list as node] <A href="${node.url}">${node.name} </A> [/#list] [/@NodeList] PONY大人亲自指点,parentId可以改为 parentId=node.parent.id 4、 页面模板变化栏目 --> 栏目模型 --->
5、 业务模型消失
6、系统--> 模型管理
栏目模型 新闻 /cover.html(默认) 判断如果 else 更多(左边)
列表页模板 /list.html
7、地址
8、列表生成格式 [@InfoPage nodeId=node.id pageSize=20;pagedList] <ul> [#list pagedList.content as info] <li> <span class="news-list-header">[@A bean=info target="_blank"/]</span> <span class="news-list-date">${info.publishDate?string('yyyy-MM-dd')}</span> </li> [/#list] </ul> [/@InfoPage]9、
[@NodeList parentId=node.id limit='5';list]
[#list list as n] <li style="height:36px;line-height:36px;padding-left:15px;[#if n_has_next]border-bottom:1px solid #fff;[/#if]background:url(_files/img/ico-point-product.png) 0 center no-repeat;"><a href="${n.url}" class="a1 fs14">${n.name}</a></li> [/#list] [/@NodeList] 10、[#if node.name == "关于我们"][@InfoList node='news';list] [#list list as info]<a href="${info.url}">${info.title}</a>
[/#list]
[/@InfoList] 答疑:1、首页模板设置http://bbs.jspxcms.com/thread-262-1-1.html2、Jspxcms分页的处理
http://www.jspxcms.com/documentation/1ba.html
背景
内容漂浮
cms 代码
一、获取位置代码
[#list node.hierarchy as n]<a href="${n.url}">${n.name}</a>[#if n_has_next]>[/#if][/#list]结果 当前位置: 首页 > 案例展示
二、
获取title内容${site.fullNameOrName}当前路径:
${ctx}三、Jspxcms标签说明:ResumeList
实现类:
com.jspxcms.plug.web.directive.VoteDirective参数:siteId:站点ID。默认当前站点。例子:[@ResumeList;resumes] [#list resumes as resume] ${(resume.creationDate?string('yyyy-MM-dd HH:mm'))!} ${resume.post?html} ${resume.name?html} [#if resume.gender=='M']男[#else]女[/#if] ${(resume.birthDate?string('yyyy-MM-dd'))!} ${resume.mobile!?html} [/#list] Jspxcms标签说明:Vote概述:
获得投票。 实现类:com.jspxcms.ext.web.directive.VoteDirective参数:siteId:站点ID。默认当前站点。id:投票ID。number:投票编码。status:状态。默认:启用状态。例子:[@Vote;vote] [#if vote??] <a href="${ctx}/vote.jspx?id=${vote.id}">${vote.title?html}</a> <form action="${ctx}/vote.jspx" method="post" id="vote"> <input type="hidden" name="id" value="${vote.id}"/> [#list vote.options as option] <input type="radio" name="optionIds" value="${option.id}"/>${option.title} [/#list] <input type="hidden" name="status_560" value="您已经投过票了"/> <input type="hidden" name="redirectUrl" value="${ctx}/vote/{id}.jspx"/> <input type="submit" value="投票"/> <a href="${ctx}/vote/${vote.id}.jspx">查看结果</a> </form> [#else] <p>没有投票</p> [/#if][/@Vote] Jspxcms标签说明:GuestbookTypeList 概述:获得留言类型列表。实现类:
com.jspxcms.ext.web.directive.GuestbookTypeListDirective参数:siteId:站点ID。默认当前站点。例子:[@GuestbookTypeList;list] [#list list as type] ${type.id},${type.name} [/#list][/@GuestbookTypeList]
Jspxcms标签说明:GuestbookList和GuestbookPage
概述:获得留言列表。实现类:com.jspxcms.ext.web.directive.GuestbookListDirectivecom.jspxcms.ext.web.directive.GuestbookPageDirective参数:siteId:站点ID。type:留言类型编码。typeId:留言类型ID。isRecommend:是否推荐。status:状态。默认:已审核。例子:[@GuestbookList;list] [#list list as guestbook] ${guestbook.creator.username}{guestbook.text!} [/#list][/@GuestbookList]Jspxcms标签说明:FriendlinkList
FriendlinkList标签概述:获得友情链接列表。实现类:
com.jspxcms.ext.web.directive.FriendlinkListDirective参数:siteId:站点ID。type:友情链接类型编码。typeId:友情链接类型ID。isWithLogo:是否有logo。isRecommend:是否推荐。status:状态。默认:已审核。例子:[@FriendlinkList typeId=type.id;list] [#list list as link] <a href="${link.url}">${link.name}</a> [/#list][/@FriendlinkList]
Jspxcms标签说明:Query
概述:执行sql查询。实现类:
com.jspxcms.core.web.directive.SQLQueryDirective参数:sql:sql查询语句。例子:[@Query sql="select t.f_user_id,t.f_username from cms_user t";list] [#list list as bean] ${bean[0]},${bean[1]} [/#list] [/@Query] Jspxcms标签说明:Node概述:
获取单个节点。实现类:
com.jspxcms.core.web.directive.NodeDirective参数:id:节点ID。number:节点编码例子:[@Node id='31';node]<a href="${node.url}">${node.name}</a>[/@Node] Jspxcms标签说明:InfoNext 概述:获取下一篇信息。实现类:
com.jspxcms.core.web.directive.InfoNextDirective参数:id:信息ID。例子:[@InfoNext id='30';bean] [#if bean??] <a href="${bean.url}">${bean.title}</a> [#else] <span>没有了</span> [/#if][/@InfoNext Jspxcms标签说明:InfoPrev概述:
获取上一篇信息。实现类:com.jspxcms.core.web.directive.InfoPrevDirective参数:id:信息ID。例子:[@InfoPrev id='30';bean] [#if bean??] <a href="${bean.url}">${bean.title}</a> [#else] <span>没有了</span> [/#if][/@InfoPrev] Jspxcms标签说明:Info概述:
获取单篇信息。实现类:
com.jspxcms.core.web.directive.InfoDirective参数:id:信息ID。例子:[@Info id='31';info]<a href="${info.url}">${info.title}</a>[/@Info]Jspxcms标签说明:TagList和TagPage
概述:获取Tag列表。实现类:
com.jspxcms.core.web.directive.TagListDirectivecom.jspxcms.core.web.directive.TagPageDirective参数:siteId:站点ID。refers:引用数量大于该值。例子: -----------------------------------------------------------------------[@TagList;list][#list list as tag] <a href="${ctx}/tag/${tag.id}.jspx">${tag.name}</a> [/#list][/@TagList]Jspxcms标签说明:SpecialList和SpecialPage
概述:获取专题列表。实现类:
com.jspxcms.core.web.directive.SpecialListDirectivecom.jspxcms.core.web.directive.SpecialPageDirective参数:siteId:站点IDcategoryId:专题类别IDbeginDate:开始时间endDate:结束时间isWithImage:是否有标题图isRecommend:是否推荐例子:----------------------------------------------------------------------[@SpecialList limit='8';list] [#list list as special] <a href="${ctx}/special/${special.id}.jspx">${special.title}</a> [/#list][/@SpecialList]Jspxcms标签说明:InfoFulltextList和InfoFulltextPage
概述:通过全文检索获取信息列表。实现类:
com.jspxcms.core.web.directive.InfoFulltextListDirectivecom.jspxcms.core.web.directive.InfoFulltextPageDirective参数:siteId:站点IDnodeId:节点IDbeginDate:开始时间endDate:结束时间q:查询字符串title:标题keyword:关键字description:描述text:正文creator:创建者用户名author:作者excludeId:不包含信息IDstatus:状态。默认:已审核fragmentSize:片段大小。默认:100。例子:[@InfoFulltextList q=info.title excludeId=info.id limit='4';list] [#list list as bean] <a href="${bean.url}">${substring(bean.title,15,'...')}</a> [/#list][/@InfoFulltextList] Jspxcms标签说明:CommentList和CommentPage 概述:获取评论列表。实现类:
com.jspxcms.core.web.directive.CommentListDirectivecom.jspxcms.core.web.directive.CommentPageDirective参数:fid:信息ID。siteId:站点ID。默认:当前站点。status:状态。默认:1(已审核)、2(推荐)。例子:[@CommentList limit='8';list] [#list list as comment] ${comment.creator.username}: ${comment.text!?html} [/#list][/@CommentList]Jspxcms标签说明:InfoList和InfoPage
实现类:
com.jspxcms.core.web.directive.InfoListDirectivecom.jspxcms.core.web.directive.InfoPageDirective参数:node:节点编码。nodeId:节点ID。nodeNumber:节点编码(支持通配符%)。excludeNodeId:不包含节点ID。excludeNode:不包含节点编码。excludeNodeNumber:不包含节点编码(支持通配符%)。attr:属性编码。attrId:属性ID。specialId:专题ID。specialTitle:专题标题。tag:tag标签名称。tagId:tag标签ID。tagName:tag标签名称(支持通配符%)。user:用户名userId:用户IDpriority:优先级beginDate:开始时间endDate:结束时间title:标题includeId:包含信息IDexcludeId:不包含信息IDstatus:状态。默认:“已审核”。isIncludeChildren:是否包含子节点。isMainNodeOnly:是否只包含主节点。isWithImage:是否有标题图。isPerm:是否有权限。例子:获取所有的信息列表 ----------------------------------------------------------
[@InfoList node='news';list]
[#list list as info] <a href="${info.url}">${substring(info.title,15,'...')}</a> [/#list][/@InfoList]Jspxcms对象说明:Friendlink
概述:友情链接对象属性:FriendlinkType type;Site site; String name;String url;Integer seq;String logo;String description;String email;Boolean recommend;Integer status;Boolean withLogo;Jspxcms标签说明:FriendlinkTypeList
FriendlinkTypeList标签概述:获得友情链接类型列表。----------------------------------------------------------实现类:
com.jspxcms.ext.web.directive.FriendlinkTypeListDirective参数:siteId:站点ID。默认当前站点。例子:[@FriendlinkTypeList;list] [#list list as type] ${type.id},${type.name} [/#list][/@FriendlinkTypeList]Jspxcms标签说明:NodeList和NodePage
-----------------------------------------------------------------------------
概述:获取节点列表,通常用于网站导航(一级节点列表)、子节点列表。实现类:com.jspxcms.core.web.directive.NodeListDirectivecom.jspxcms.core.web.directive.NodePageDirective参数:parentId:父节点ID。整型。parent:父节点编码。字符串。isHidden:是否前台隐藏。布尔型。isRealNode:是否真实节点(是否有信息的节点)。布尔型。isIncludeChildren:是否包含子节点。布尔型。例子:[@NodeList;list][#list list as node] <a href="${node.url}">${node.name}</a>[/#list][/@NodeList]-----------------------------------------------------------------------------
InfoList标签概述:InfoList是获取信息列表的标签,是Jspxcms制作模板使用的最多、最核心的标签之一。例子:[@InfoList node='news';list] [#list list as info] <li><a href="${info.url}">${substring(info.title,15,'...')}</a></li> [/#list][/@InfoList]参数:node:节点编码nodeId:节点IDattr:属性编码attrId:属性ID.....(待续)