zoukankan      html  css  js  c++  java
  • jspxcms笔记三

    首页 index.html site :站点对象
    栏目 cover.html list.html node :栏目对象, text :正文
    详细 info.html node :栏目对象, info :文档对象, title标题, text:正文

    一、index.html
    1、首页title内容 ${site.fullNameOrName}
    <meta name="keywords" content="${node.keywords}"/>
    <meta name="description" content="${node.description}"/>

    2、动态包含: [#include 'inc_js.html'/]
    3、热度排行代码:
    获得所有文档列表
    <ul class="list-unstyled" style="padding:10px;">
    [@InfoList sort='views desc' limit='10';list]
    [#list list as info]
    <li style="height:28px;line-height:28px;"><span class="left text-center [#if info_index<3]rank-top[#else]rank-normal[/#if]" style="margin-right:10px;">${info_index+1}</span><a class="a fs14" href="${info.url}" target="_blank" title="${info.title}">${substring(info.title,18,'...')}</a></li>
    [/#list]
    [/@InfoList]
    </ul>
    ${info_index+1} 信息数目
    ${substring(info.title,18,'...')} 信息的标题
    ${info.url} 内容的链接地址

    4、获得栏目对象 (栏目)
    <a class="b c-node fs14 a-hover" href="${getNode('trade').url}">${getNode('trade').name}</a>
    7、获取单个指定的栏目 (栏目)
    [@Node number='trade';node]<a class="c-node fs14 b a-hover" href="${node.url}">${node.name}</a>[/@Node]

    5、获得文档属性为头条的列表 (头条属性下的文档列表)
    第一条
    往后的2,3条列表
    [@InfoList attr='headlines' limit='3';list]
    [#if list?size > 0]
    <div class="text-center" style="height:38px;line-height:38px;">
    <a class="fs14 b a-hover c-infoem" href="${list[0].url}" target="_blank" title="${list[0].title}">${substring(list[0].title,18,'...')}</a>
    </div>
    [/#if]

    <ul class="list-unstyled text-center" style="height:30px;line-height:30px;">
    [#list list as info]
    [#if info_index > 0]
    <li class="left" style="50%;">[<a class="a-hover c-infoem" href="${info.url}" target="_blank" title="${info.title}">${substring(info.title,11,'...')}</a>]</li>
    [/#if]
    [/#list]
    </ul>
    [/@InfoList]

    trade
    6、获取新闻栏目文档 (栏目下文档列表)
    [@InfoList node='news' isIncludeChildren='true' limit='14';list]
    [#list list as info]
    <li class="item ico-point-blue">
    <a class="fs14 [#if info_index=4 || info_index=9 || info.strong] c-infoem a-hover b[#else]a[/#if]" href="${info.url}" target="_blank" title="${info.title}">${substring(info.title,20,'...')}</a>
    </li>
    [#if info_index = 3 || info_index = 8]
    <li class="spacing"></li>
    [/#if]
    [/#list]
    [/@InfoList]

    8、获得指定栏目列表 同6一样。(文档)
    [@InfoList node='video' isIncludeChildren='true' limit='2';list]
    [#list list as info]
    <li class="[#if info_index % 2 = 0]left[#else]right[/#if]" style="132px;">
    <a class="block relative" style="132px;height:88px;" href="${info.url}" target="_blank" title="${info.title}">
    <img src="${info.smallImageUrl}" width="132" height="88"/>
    <div class="trans c-000 absolute" style="bottom:0;height:22px;line-height:22px;100%;">
    <div class="relative c-fff text-right play">&nbsp;${info.videoTime}</div>
    </div>
    </a>
    <div class="text-center" style="height:28px;line-height:28px;"><a class="fs12 a" href="${info.url}" target="_blank" title="${info.title}">${substring(info.title,9,'...')}</a></div>
    </li>
    [/#list]
    <div class="clear"></div>
    [/@InfoList]

    9、获得一个专题
    [@SpecialList limit='1';list]
    [#list list as special]
    <div style="padding:10px;">
    <a class="left" style="130px;" href="${ctx}/special/${special.id}.jspx" target="_blank" title="${special.title}">
    <img src="${special.smallImageUrl}" width="130" height="87"/>
    </a>
    <div class="right" style="158px;margin-left:10px;">
    <div><a class="fs14 b a-hover c-infoem" href="${ctx}/special/${special.id}.jspx" title="${special.title}" target="_blank">${substring(special.title,10,'...')}</a></div>
    <div class="mt5 c-desc">${substring(special.description,32,'...')} <a class="c-node a-all" href="${ctx}/special/${special.id}.jspx" target="_blank">[详细]</a></div>
    </div>
    <div class="clear"></div>
    </div>
    [/#list]
    [/@SpecialList]

    10、获得除第一个专题外其他专题(专题)
    [@SpecialList offset='1' limit='6';list]
    <ul class="mt5 list-unstyled" style="padding:10px 10px;border-top:1px dotted #d2e1f1;">
    [#list list as special]
    <li style="height:26px;line-height:26px;"><a class="fs14 a" href="${ctx}/special/${special.id}.jspx" target="_blank" title="${special.title}">${substring(special.title,20,'...')}</a></li>
    [/#list]
    </ul>
    [/@SpecialList]

    11、获取新闻栏目 子栏目列表
    带图片的一条
    其他子栏目不带图片的列表

    [@NodeList parent='news';list]
    [#list list as node]
    <div class="w1 [#if node_index%2 = 0]left[#else]right ml20[/#if]">
    <div class="box1">
    <div class="head"><a class="b c-node fs14 a-hover" href="${node.url}">${node.name}</a></div>
    </div>
    [@InfoList nodeId=node.id isWithImage='true' limit='1';list]
    [#list list as info]
    <div style="padding:10px;">
    <a class="left" style="130px;" href="${info.url}" target="_blank" title="${info.title}">
    <img src="${info.smallImageUrl}" width="130" height="87"/>
    </a>
    <div class="right" style="158px;margin-left:10px;">
    <div><a class="fs14 b a-hover c-infoem" href="${info.url}" title="${info.title}" target="_blank">${substring(info.title,10,'...')}</a></div>
    <div class="mt5 c-desc">${substring(info.description,32,'...')} <a class="c-node a-all" href="${info.url}" target="_blank">[详细]</a></div>
    </div>
    <div class="clear"></div>
    </div>
    [/#list]
    [/@InfoList]
    [@InfoList nodeId=node.id limit='5';list]
    <ul class="mt5 list-unstyled" style="padding:10px 10px;border-top:1px dotted #d2e1f1;">
    [#list list as info]
    <li class="ico-point-blue" style="padding-left:10px;height:26px;line-height:26px;"><a class="fs14 a" href="${info.url}" target="_blank" title="${info.title}">${substring(info.title,20,'...')}</a></li>
    [/#list]
    </ul>
    [/@InfoList]
    </div>
    [/#list]
    <div class="clear"></div>
    [/@NodeList]

    12、获得文旦属于下载栏目
    1、子栏目的名称${info.node.name}
    2、字段 ${info.customs['star']}

    [@InfoList node='download' isIncludeChildren='true' limit='9';list]
    [#list list as info]
    <li class="left" style="193px;padding-right:20px;">
    <div class="left" style="padding:10px;"><img src="${info.smallImageUrl}" width="50" height="50"/></div>
    <div class="left" style="padding-top:6px;123px;">
    <div><a class="fs14 b c-infoem a-hover" href="${info.url}" target="_blank" title="${info.title}">${substring(info.title,10)}</a></div>
    <div><a class="a" href="${info.node.url}">${info.node.name}</a></div>
    <div style="color:#fe6500;">${info.customs['star']}</div>
    </div>
    <div class="clear"></div>
    </li>
    [/#list]
    [/@InfoList]
    13、投票

    [@Vote;vote]
    [#if vote??]
    <div class="text-center" style="padding:5px 10px;"><a class="c-infoem fs14 a-hover" href="${ctx}/vote.jspx?id=${vote.id}" target="_blank">${vote.title?html}</a></div>
    <form action="${ctx}/vote.jspx" method="post" id="voteForm">
    <input type="hidden" name="id" value="${vote.id}"/>
    <ul class="list-unstyled">
    <label for="optionIds" class="hide error"></label>
    [#list vote.options as option]
    <li style="padding:5px 0;"><label><input type="[#if vote.maxSelected==1]radio[#else]checkbox[/#if]" name="optionIds" value="${option.id}" class="required" data-msg-required="请至少选择一项"/> ${option.title}</label></li>
    [/#list]
    </ul>
    <input type="hidden" name="status_560" value="您已经投过票了"/>
    <input type="hidden" name="redirectUrl" value="${ctx}/vote/{id}.jspx"/>
    <div class="text-center" style="padding:10px 0 20px 0;">
    <input type="submit" value="投票"/> &nbsp;
    <a class="a fs14" href="${ctx}/vote/${vote.id}.jspx" target="_blank">查看结果</a>
    </div>
    </form>
    <script>
    $(function() {
    $("#voteForm").validate();
    });
    </script>
    [#else]
    <div>没有投票</div>
    [/#if]
    [/@Vote]

    14、获得当前页

    <a class="right block" style="228px;height:90px;background:url(_files/img/logo.png) no-repeat;" href="${ctx}/"></a>

    15、获得栏目列表(栏目)

    [@NodeList;list]
    [#list list as n]
    <li class="left"><a href="${n.url}" class="nava fs14 item[#if (node.hierarchy[1])?? && node.hierarchy[1].id == n.id] curr[/#if][#if n_has_next] middle[#else] last[/#if]">${n.name}</a></li>
    [/#list]
    [/@NodeList]

    cover.html

    1、获得栏目
    ${n.name} 子栏目
    ${n.url} 子栏目地址


    [@NodeList parentId=node.id;list]
    [#list list as n]
    <div class="w center mt30" style="height:22px;line-height:22px;background:url(_files/img/phone_bg.jpg) right center no-repeat;">
    <div class="left ff-yh fs18" style="100px;border-left:7px solid #e71a21;padding-left:18px;">${n.name}</div>
    <div class="right" style="100px;padding-right:18px;text-align:right;"><a href="${n.url}" class="a-hover c-666">更多</a></div>
    <div class="clear"></div>
    </div>
    <div class="w center mt20">
    [@InfoList nodeId=n.id limit='8';list]
    [#list list as info]
    <div class="left mt5 relative" style="[#if (info_index+1) % 4 !=0]margin-right:5px;[/#if]">
    <a href="${info.url}" target="_blank" title="${info.title}">
    <img src="${info.smallImageUrl}" width="246" height="164"/>
    <div class="absolute" style="100%;height:75px;bottom:0;background:url(_files/img/pic_bg.png) left bottom;"></div>
    <div class="absolute text-center ff-yh fs14" style="bottom:5px;100%;text-align:center;">
    <span class="relative c-fff">${substring(info.title,15,'...')}</span>
    </div>
    </a>
    </div>
    [/#list]
    [/@InfoList]
    <div class="clear"></div>
    </div>
    [/#list]
    [/@NodeList]


    list.html

    1、所有文档内容 列表 分页

    [@InfoPage nodeId=node.id pageSize='15';pagedList]
    <ul class="list-unstyled mt10">
    [#list pagedList.content as info]
    <li style="padding:15px 0;border-bottom:1px dotted #ccc;">
    [#if info.withImage]
    <div class="left" style="padding:3px 10px 3px 0;22%;">
    <a href="${info.url}" target="_blank"><img src="${info.smallImageUrl}" width="138" height="92"/></a>
    </div>
    [/#if]
    <div class="left" style="[#if info.withImage]75%;[/#if]">
    <div>[@A bean=info class='ff-yh fs18 a c-000' target="_blank"/]</div>
    <div class="" style="line-height:1.8;padding:2px 0;color:#818181;">${substring(info.description,100,'...')}</div>
    <div class="" style="padding:2px;color:#a1a1a1;">${info.publishDate?string('yyyy-MM-dd HH:mm:ss')}</div>
    </div>
    <div class="clear"></div>
    </li>
    [/#list]
    </ul>
    <table class="center mt20"><tr><td>
    [#include 'page.html'/]
    </td></tr></table>
    [/@InfoPage]

    info.html

    1、获得栏目
    [#list node.hierarchy as n]<a href="${n.url}" class="a c-desc">${n.name}</a> > [/#list]
    2、编辑时间
    <span class="info-detail">${info.publishDate?string('yyyy-MM-dd')}</span>
    3、作者
    <span class="info-detail">${info.author!info.creator.realName!info.creator.username}</span>


    [#include "_include/include_footer.html"/]
    [@InfoFulltextList q=info.title excludeId=info.id limit=5;list]
    <ul class="list-unstyled info-list fs14 mt10">
    [#list list as fulltextInfo]
    <li class="item ico-point-blue" >[@A bean=fulltextInfo target="_blank" class="a"/] <span class="fs12 c-999 ml5">${fulltextInfo.publishDate?string('yyyy-MM-dd')}</span></li>
    [/#list]
    </ul>
    [/@InfoFulltextList]


    模块里建立:
    1、专题类别 国际

    2、专题管理

    马航客机失联
    马航客机失联,MH370,马来西亚,飞机,北京,失联
    马来西亚航空公司8日凌晨,与一架载有239人的飞机失去联系。这架航班上共载227名乘客,含154名中国人。客机系波音777-200型号,计划于北京时间6:30分抵达北京。

    2014索契冬奥会
    冬奥会, 2014冬奥会,索契冬奥会,2014索契冬奥会, 第22届冬奥会, 冬季奥林匹克运动会
    第22届冬季奥林匹克运动会于2014年2月7日~23日召开

    小图


    专题列表
    [@SpecialList limit='1';list]
    [#list list as special]
    ${ctx}/special/${special.id}.jspx
    标题 ${substring(special.title,10,'...')}
    内容 ${substring(special.description,32,'...')}
    [/#list]
    [/@SpecialList]

  • 相关阅读:
    游戏服务器架构概要
    牛客网_Go语言相关练习_选择题(3)
    Go语言实践_实现一(服务器端)对多(客户端)在线聊天室
    Go语言实践_实现一(客户端)对一(服务器端)聊天室
    牛客网_Go语言相关练习_选择题(2)
    飞鱼48小时游戏创作嘉年华_厦门Pitch Time总结与收获
    牛客网_Go语言相关练习_选择题(1)
    Go语言_iota用法
    游戏服务器概述
    LeetCode_1. Two Sum_Solution
  • 原文地址:https://www.cnblogs.com/y896926473/p/5338082.html
Copyright © 2011-2022 走看看