A-A+

PHPCMS文章页模板制作

2014年12月31日 PHP开源系统 暂无评论 阅读 21 views 次

在PHPCMS中制作文章页模板还是比较简单的,首先我们需要在模板目录 content 下面新建 show.html 文件,这个文件就是PHPCMS文章页了,这里把这个页面常用的一些文章页标签标记出来,在使用的时候方便直接调用。

调用顶部模板与页尾模板:

{template "content","header"}

{template "content","header"}

页面当前位置:

<a href="{siteurl($siteid)}">首页</a> &gt; {catpos($catid)} 列表</div>

标题关键词描述:

<title>{if isset($SEO['title']) && !empty($SEO['title'])}{$SEO['title']}{/if}{$SEO['site_title']}</title>

<meta name="keywords" content="{$SEO['keyword']}">

<meta name="description" content="{$SEO['description']}">

常用标签:

{$title} 文章标题

{$copyfrom} 文章来源

{$inputtime} 添加日期

{$url} 文章链接 仅限于动态或伪静态页面,纯静态页面请使用 {go($catid,$id)}

{$content} 文章内容

点击数调用,必须先调用jquery库,比如:

<script src="https://www.xiariboke.net/statics/js/jquery.min.js"></script>

在需要的位置加入如下代码:<span id="hits"></span>

最后还需要调用下统计代码:

<script src="{APP_PATH}api.php?op=count&amp;id={$id}&amp;modelid={$modelid}"></script>

统计代码不能缺少,否则不能正常显示点击数。

上一篇:<a href="{$previous_page[url]}">{$previous_page[title]}</a>

下一篇:<a href="{$next_page[url]}">{$next_page[title]}</a>

调用文章评论框:

{if $allow_comment && module_exists('comment')}
<iframe src="{APP_PATH}index.php?m=comment&c=index&a=init&commentid={id_encode("content_$catid",$id,$siteid)}&iframe=1" width="100%" height="100%" id="comment_iframe" frameborder="0" scrolling="no"></iframe>
{/if}

一个普通的文章内容页基本上就是上面的这些元素了,对了还有一些侧边栏的栏目最新文章,评论文章排行等,可以参看夏日博客前面所写的栏目调用文章了。

标签:

给我留言