SSCMS常用模板语句

1、TDK
根据页面类型做判断,统一写比较简单:首页/栏目页/内容页

	<stl:if type="TemplateType" op="In" value="IndexPageTemplate,FileTemplate">
		<stl:yes>
			<title>{Stl.SiteName}-热点新闻时间+地点+照片</title>
			<meta name="keywords" content="{Stl.SiteKeywords}">
			<meta name="description" content="{Stl.SiteDescription}">
		</stl:yes>
	</stl:if>
	<stl:if type="TemplateType" op="Equals" value="ChannelTemplate">
		<stl:yes>
			<title>{channel.title}-{Stl.SiteName}</title>
			<meta name="keywords" content="{channel.Keywords}">
			<meta name="description" content="{channel.description}">
		</stl:yes>
	</stl:if>
	<stl:if type="TemplateType" op="Equals" value="ContentTemplate">
		<stl:yes>
			<stl:if type="ChannelIndex" op="In" value="行业快讯,热点推荐">
				<stl:yes>
					<title>{content.title}</title>
					<meta name="keywords" content="{content.Keywords}">
					<meta name="description" content="{content.Summary}">
				</stl:yes>
				<stl:no>
					<title>{content.title}-{Stl.SiteName}</title>
					<meta name="keywords" content="{content.Keywords}">
					<meta name="description" content="{content.Summary}">
				</stl:no>
			</stl:if>
		</stl:yes>
	</stl:if>

2、面包屑导航

您当前的位置:<stl:location separator=" / "></stl:location>

3、当前时间

当前日期(格式 年月日):<stl:value type="date" format="yyyy-MM-dd"></stl:value>
当前日期(格式 年月日 时:分):<stl:value type="date" format="yyyy-MM-dd HH:mm"></stl:value>

4、当前栏目名称&子栏目列表

**当前栏目名称:** <stl:a href="">{Channel.Title}</stl:a>
**子栏目列表:**
<stl:channels >
  <stl:a><stl:channel type="title"></stl:channel></stl:a><br />
</stl:channels>

5、当前栏目部份带图片的内容列表(是否热点、标题、图片、点击率、时间、简介)
如果用在首页或须指定栏目的,加上栏目索引属性:channelIndex=“news” ,如:
<stl:contents channelIndex=“news” isImage=“true” totalNum=“8”>

**当前栏目部份带图片的内容列表**
<stl:contents isImage="true" totalNum="8">
      <stl:if type="IsHot" operate="Equals" value="true">
           <span class="hot-icon">热点</span> 
      </stl:if>
     <stl:a title="{Content.FullTitle}" target="_blank">
     <stl:image></stl:image>
     <stl:content type="Title"></stl:content>
     点击:<stl:content type="Hits"></stl:content>
     时间:<stl:content type="AddDate" format="yyyy-MM-dd hh:mm:ss"></stl:content>
     简介:<stl:content type="summary"></stl:content>
     带链接的标签:
      <stl:tags totalNum="3">
            <a href="{Stl.SiteUrl}/utils/tags.html?tagName={Tag.Name}" rel="tag">{Tag.Name}   </a>
      </stl:tags>
  </stl:a>
</stl:contents>

6、内容页常用字段&上一篇,下一篇

标题:{Content.Title}
副标题:{Content.SubTitle}
简介:{Content.Summary}
作者:{Content.Author}
添加时间:{Content.AddDate}
点击:{Content.Hits}
头图:<stl:image></stl:image>
视频:<stl:video></stl:video>
内容:{Content.Body}
当前页链接:{Content.NavigationUrl}

<stl:navigation tipText="上一篇:" emptyText="无" type="PreviousContent"></stl:navigation>
<stl:navigation tipText="下一篇:" emptyText="无" type="NextContent"></stl:navigation>

7、Tag列表

<stl:tags totalNum="10">
  <a href="{Stl.SiteUrl}/utils/tags.html?tagName={Tag.Name}" rel="tag">
     {Tag.Name}
  </a>
</stl:tags>

8、生成网站地图 Sitemap的内容页模板

<h1>{Stl.siteName}-网站地图SiteMap</h1>
<h5>生成时间:<stl:value type="date" format="yyyy-MM-dd HH:mm"></stl:value></h5>
<hr />
<!--栏目页-->
<stl:channels channelIndex="首页" scope="all">    
  <stl:a><stl:channel type="title"></stl:channel></stl:a><br />  
</stl:channels>    

<!--内容页-->
<stl:contents topLevel="0" scope="descendant" order="addDateBack">
  <stl:a>
    <stl:content type="Title"></stl:content>
    (<stl:content type="lastModifiedDate" formatString="yyyy-MM-dd"></stl:content>)
  </stl:a>
</stl:contents>
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值