TRS海云系统学习
trs海云系统学习和动易标签方法对比
获取节点名称带链接:
<trs_channel id="tzgg" autolink="true"/>
@Power.Url.NodeLink("通知公告")
获取节点链接地址:
<trs_channel id='通知公告' field='_recurl' />
@Power.Url.NodeUrl("tzgg")
标题列表形式(获取通知公告8条内容,标题长度70,时间格式月-日):
<trs_documents id= "通知公告" num="8" order="docreltime desc">
<li>
<span class="date"><trs_document field='docreltime' dateformat='MM-dd'/></span>
<a href="<trs_document field='_recurl' />"><trs_document field="doctitle" num="70" autolink="false"/></a>
</li>
</trs_documents>
@Power.ArticleList("文章标题列表" , new { Node = "tzgg", Count = 8, TitleLength = 70, showDate = true, DateFormat = "MM-dd", RefNode = true })
文章焦点图(宽度500,显示5条,标题长度50):
<div class="focus">
<div class="bd">
<ul>
<trs_documents id="通知公告" startpos="0" num="5" order="docreltime desc" where="attachpic in(1,3)">
<li>
<div class="pic">
<a href="<trs_document field='_recurl' />" target="_blank">
<img src="<trs_appendix field='_recurl' mode='pic' index='0' upload='true' width='600' />" />
</a>
</div>
<div class="con">
<span class="titleBg"></span>
<h3 class="title">
<a href="<trs_document field='_recurl' />" target="_blank">
<trs_document field="doctitle" num="50" autolink="false"/>
</a>
</h3>
</div>
</li>
</trs_documents>
</ul>
</div>
<div class="hd">
<ul>
<trs_documents id="通知公告" startpos="0" num="5" order="docreltime desc" where="attachpic in(1,3)">
<li>
<span></span>
</li>
</trs_documents>
</ul>
</div>
</div>
<div class="focus">
@Power.Partial("文章焦点图", new { Count = 5, NodeIdentifier = "tzgg", TitleLength = 50, ContentLength = 0, ImageWidth = 600, ImageHeight = 400 })
</div>
节点列表(纯文字):
<trs_channels id="通知公告" num="5">
<li chnl='<trs_channel field="channelid" />'><trs_channel field="chnldesc" autolink="true" /></li>
</trs_channels>
@Power.Partial("节点列表", new { Count = 5, NodeIdentifier = "tzgg" })
节点列表(带图片):
<trs_channels id="通知公告" num="5">
<li>
<a class="pic" href="<trs_channel field='_recurl'/>"><img src="<trs_channellogo mode='pic' index=1 upload='true' width='220'/>" /></a>
<trs_channel field="chnldesc" autolink="true" />
</li>
</trs_channels>
@Power.Partial("节点列表", new { Count = 5, NodeIdentifier = "tzgg", ShowPic = true, ImageWidth = 220, ImageHeight = 75 })其它常用置标:
文章链接 <trs_document field='_recurl' /> 文章标题 <trs_document field="doctitle" autolink="false" num="50" /> 文章副标题 <trs_document field='subdoctitle' autolink='false' /> 文章日期 <trs_document field="docreltime" dateformat="yyyy-MM-dd" /> 文章摘要 <trs_document field="docabstract" num="80" /> 栏目链接 <trs_channel field='_recurl' id='通知公告'/> 栏目名称 <trs_channel field="chnldesc" autolink="false" id="通知公告" /> 栏目描述: <trs_channel field='channeldescription'/> 当前位置: <TRS_CURPAGE value=" > " only="FALSE" autolink="false" homepagedesc="首页" ></TRS_CURPAGE> 图片附件 <trs_appendix field='_recurl' mode='pic' index='0' upload='true' /> 取父栏目的父栏目(以此类推更高层级的也可以用类似的写法) <trs_channel field="_recurl" id="parent:2"/>
文章内容页字段置标: 获取文章的标题:<trs_document field='doctitle' autolink='false' codefiltered='true'/> 获取文章的副标题:<trs_document field='subdoctitle' autolink='false' /> 获取文章的摘要:<trs_document field='docabstract' autoformat='true' autoformattype='innertext' /> 获取文章的作者:<trs_document field='docauthor' /> 获取文章的来源:<trs_document field='docsource' /> 获取文章的撰写时间:<trs_document field='docreltime' dateformat='yyyy-MM-dd HH:mm:ss' /> 获取文章纯文本正文:<trs_document field='doccontent' /> 获取文章带样式的正文:<trs_document field='dochtmlcon' /> 获取文章的相关新闻: <trs_relnews mode="all"> //userdef:用户手动设置的相关新闻,keywords:通过文章的关键词匹配的相关新闻,all:前面两者获取到的相关新闻,并去除重复的 <trs_document field='doctitle' autolink='false' codefiltered='true'/> </trs_relnews>
