在邱嵩松sdcms标签、模板与仿站教程 2-5 这一节中,我们讲讲sdcms最常用到的页面,即内容页的仿制。
首先是head区,标题、关键字、描述必不可少,
<title>{sdcms:info_title}</title>
<meta name="keywords" content="{sdcms:info_keyword}" />
<meta name="description" content="{sdcms:info_desc}" />
所在位置:您的位置:<a href="{sdcms:root}">网站首页</a> {sdcms:info_position}
文章信息:标题:{sdcms:info_title} 作者:{sdcms:info_author} 来源:{sdcms:info_comefrom} 日期:{sdcms:info_date} 人气:<span id="show_i_hits"><script>get_hits({sdcms:info_hits},"show_i_hits")</script></span> 标签:{sdcms:info_tags}
内容正文:{sdcms:info_content}
内容分页:{sdcms:info_page}
上下篇:上一篇:{sdcms:loop top="1" table="sd_info" where="where id<{sdcms:info_id} and ispass=1 and iscreate=1"}<eof>没有资料</eof><a href="{link}" [if {isurl}=1]target="_blank"[end if]>{title}</a>{/sdcms:loop} 下一篇:{sdcms:loop top="1" table="sd_info" where="where id>{sdcms:info_id} and ispass=1 and iscreate=1" order="id"}<eof>没有资料</eof><a href="{link}" [if {isurl}=1]target="_blank"[end if]>{title}</a>{/sdcms:loop}
热门文章:{sdcms:loop table="sd_info" top="7" where="where ispass=1 and iscreate=1" order="hits desc,id desc"}
<dt><a href="{link}" title="{title}" [if {isurl}=1]target="_blank"[end if]>{title len="16"}</a></dt>
{/sdcms:loop}
推荐文章:{sdcms:loop table="sd_info" top="10" where="where isnice=1 and ispass=1 and iscreate=1"}
<eof><dt>没有资料</dt></eof>
<dt><a href="{link}" title="{title}" [if {isurl}=1]target="_blank"[end if]>{title len="16"}</a></dt>
{/sdcms:loop}
相关文章:{sdcms:loop table="sd_info" top="10" where="where id in({sdcms:info_likeid}) and ispass=1 and iscreate=1"}
<eof><dt>没有资料</dt></eof>
<dt><a href="{link}" title="{title}" [if {isurl}=1]target="_blank"[end if]>{title len="26"}</a></dt>
{/sdcms:loop}
用以上部分替换模板中相应位置即可。其他分部请参照默认模板,不再详述,建议栏目和底部版权等部分使用后台的标签功能单独来写,方便修改。除非栏目很多或不会再改,不然不推荐大家用栏目直接调用的方法。更多调用方法,参见sdcms帮助手册。下一节我们来讲sdcms列表页的仿制教程。