SSCMS常用模板语句

1、TDK

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

bash 复制代码
	<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、内容页常用字段&上一篇,下一篇

bash 复制代码
标题:{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>
相关推荐
康妮猫3 个月前
配置sscms时被sql server处处刁难
sscms
康妮猫6 个月前
建站新手:我与SiteServerCMS的爱恨情仇(三)
html·sscms·surveyking