phpcms若何增加模板?
本文以增加频道页模板为例进行解说,其余顺次类推,触类旁通。
一、假定咱们曾经新建了“phpcms教程”栏目,而此栏目的模板不克不及用默许的需求新建
关上 /phpcms/templates/default/content 目次,并建设如下文件:
栏目首页模板:category_cmsjc.html
栏目列表页模板:list_cmsjc.html
内容页模板:show_cmsjc.html
留意:
我增加的栏目称号是以 category_ 、 list_ 、 show_ 扫尾的
category_ 扫尾的文件会正在抉择模板的时分被主动辨认为“栏目首页模板”,而没有会正在此外模板选项里呈现
list_ 扫尾的文件会正在抉择模板的时分被主动辨认为“栏目列表页模板”,而没有会正在此外模板选项里呈现
show_ 扫尾的文件会正在抉择模板的时分被主动辨认为“内容页模板”,而没有会正在此外模板选项里呈现
增加其他的模板依此类推,触类旁通
建设实现后正在抉择模板的时分就能够显示进去,然而没有会像默许的那样呈现“文章频道页(category.html)”而是呈现“category_cmsjc.html”,呈现这类状况阐明咱们还要持续修正。
二、关上 /phpcms/templates/default/config.php 文件
找到
'templates|default|content' => array ( 'category.html' => '文章频道页', 'category_download.html' => '下载频道页', 'category_picture.html' => '图片频道页', 'download.html' => '下载衔接页', 'footer.html' => '底部', 'header.html' => '顶部', 'header_min.html' => '迷你顶', 'header_page.html' => '单网页头部', 'index.html' => '网站首页', 'list.html' => '列表页', 'list_download.html' => '下载列表页', 'list_picture.html' => '图片列表页', 'message.html' => '音讯提醒页', 'page.html' => '单网页', 'rss.html' => 'RSS页', 'search.html' => '搜寻', 'show.html' => '文章内容页', 'show_download.html' => '下载内容页', 'show_picture.html' => '图片内容页', 'tag.html' => 'tag', ),
正在此数组里恣意地位增加便可,CMS集中营站长的习气是将内容增加到对应的称号下边:
'templates|default|content' => array ( 'category.html' => '文章频道页', 'category_download.html' => '下载频道页', 'category_picture.html' => '图片频道页', 'category_cmsjc.html' => 'phpcms教程文章频道页', 'download.html' => '下载衔接页', 'footer.html' => '底部', 'header.html' => '顶部', 'header_min.html' => '迷你顶', 'header_page.html' => '单网页头部', 'index.html' => '网站首页', 'list.html' => '列表页', 'list_download.html' => '下载列表页', 'list_picture.html' => '图片列表页', 'list_cmsjc.html' => 'CMS集中营列表页', 'message.html' => '音讯提醒页', 'page.html' => '单网页', 'rss.html' => 'RSS页', 'search.html' => '搜寻', 'show.html' => '文章内容页', 'show_download.html' => '下载内容页', 'show_picture.html' => '图片内容页', 'show_cmsjc.html' => 'CMS教程文章内容页', 'tag.html' => 'tag', ),
如斯操作后再抉择模版的时分就与默许的款式同样了“phpcms教程文章频道页(category_cmsjc.html)”
PHP中文网,年夜量的收费PHPCMS教程,欢送正在线学习!
以上就是phpcms若何增加模板的具体内容,更多请存眷资源魔其它相干文章!
标签: phpcms phpcms教程 phpcms技巧 php问题解决
抱歉,评论功能暂时关闭!