内容页是每个站点都必须要有的模板,最常见的就是文章的内容页,再者有下载内容页,产品内容页,视频内容页等等,但一般不大的站点都一定要有其文章的内容页,其它几个可以没有,在内容页当中,其实是有一些固定的模板标签的,我们只需要调用就可以了,这些标签可以在 phpcms v9 里面摘出来,在使用的时候直接调用很方便的,现在就来总结一下内容页 show 模板调用的标签。
1、页面标题:{$title}
2、发表时间:{$inputtime}
3、内容来源:{$copyfrom}
4、文章内容:{$content}
5、缩略图地址:{$thumb}
6、组图列表:
1
2
|
{loop
$photos
$r
}
<li><a href=
"{$r[url]}"
><img src=
"{thumb($r[url], 75, 45, 0)}"
/>{/loop}
|
注释:其中$photos为自定义组图字段,{$r[url]}为图片地址,{thumb($r[url], 75, 45, 0)}为图片缩略图,{$r[alt]}为图片描述。
7、栏目名称与栏目拼音与栏目链接:{$CAT[catname]} 与 {$CAT[letter]} 与 {$CAT[url]}
8、同级栏目列表:
1
2
3
4
5
|
{pc:content action=
"category"
catid=
"$parentid"
num=
"12"
siteid=
"$siteid"
order=
"listorder ASC"
}
{loop
$data
$r
}
<li><a href=
"{$r[url]}"
>{
$r
[catname]}</a></li>
{/loop}
{/pc}
|
9、父栏目名称与链接:{$CATEGORYS[$CAT[parentid]][catname]} 与 {$CATEGORYS[$CAT[parentid]][url]}
10、一级父栏目列表:
1
2
3
4
5
|
{pc:content action=
"category"
catid=
"0"
num=
"34"
siteid=
"$siteid"
order=
"listorder ASC"
}
{loop
$data
$r
}
<li><a href=
"{$r[url]}"
>{
$r
[catname]}</a></li>
{/loop}
{/pc}
|
11、 获取上上级栏目名称与链接:{$CATEGORYS[$CATEGORYS[$CAT[parentid]][parentid]][catname]} 与 {$CATEGORYS[$CATEGORYS[$CAT[parentid]][parentid]][url]}
12、上一篇:{$previous_page[url]}、{$previous_page[title]},下一篇:{$next_page[url]}、{$next_page[title]}。
13、相关热词搜索:
1
2
3
|
{loop
$keywords
$keyword
}
<a href=
"{APP_PATH}index.php?m=content&c=tag&catid={$catid}&tag={urlencode($keyword)}"
class
=
"blue"
>{
$keyword
}</a>
{/loop}
|
14、点击统计:,注意在底部加上统计代码:
15、相关文章调用:
1
2
3
4
5
6
7
8
9
10
11
12
|
{pc:content action=
"relation"
relation=
"$relation"
id=
"$id"
catid=
"$catid"
num=
"5"
keywords=
"$rs[keywords]"
}
{
if
$data
}
<div
class
=
"related"
>
<h5
class
=
"blue"
>延伸阅读:</h5>
<ul
class
=
"list blue lh24 f14"
>
{loop
$data
$r
}
<li>·<a href=
"{$r[url]}"
target=
"_blank"
>{
$r
[title]}</a><span>({
date
(
'Y-m-d'
,
$r
[inputtime])})</span></li>
{/loop}
</ul>
</div>
{/
if
}
{/pc}
|
这些模板标签都可以在 phpcms v9 默认模板里面找出来,这里记录一下方便自己在做模板时直接拿来调用,当然我们可以举一反三,比如列表页 list.html 模板标签,首页 index.html 模板标签,把这些标签都收集下来,可以提高自己制作模板的效率额。