Eyoucms自定义tag模板风格的方法
Eyoucms自定义tag模板风格的方法:涉及的修改文件:
1、application\home\controller\tags.php文件
找到:
if (!empty($tagindexInfo)) { $tagid = $tagindexInfo['id']; $tag = $tagindexInfo['tag']; |
下面增加:
$viewfile = $tagindexInfo['viewfile']; |
找到:
$field_data = array( 'tag' => $tag, 'tagid' => $tagid, |
下面增加:
'viewfile' => $viewfile, |
找到:
/*模板文件*/ $viewfile = 'lists_tags'; |
改为:
/*模板文件*/if($viewfile) { $viewfile = $viewfile;}else{ $viewfile = 'lists_tags';} |
保存。
2、application\admin\controller\Tags.php
找到
/** * 编辑 */ public function edit() { if (IS_POST) { $post = input('post.'); if (empty($post['id'])) $this->error('操作异常'); $updata = [ 'add_time' => time(), '<a href="https://www.tbadc.com/tags/73.html" target="_blank">SEO</a>_title' => !empty($post['tag_seo_title']) ? $post['tag_seo_title'] : '', 'seo_keywords' => !empty($post['tag_seo_keywords']) ? $post['tag_seo_keywords'] : '', |
下面增加
'viewfile' => !empty($post['viewfile']) ? $post['viewfile'] : '', |
3、application\admin\template\tags\edit.htm
找到
<dl class="row"> <dt class="tit"> <label for="tag_seo_description">SEO描述</label> </dt> <dd class="opt"> <textarea rows="5" cols="60" name="tag_seo_description" id="tag_seo_description" style="height: 60px;">{$tag.seo_description}</textarea> <p class="notic">标签调用方法:{literal}{$eyou.field.seo_description}{/literal}</p> </dd> </dl> |
下面增加
<dl class="row"><dt class="tit"> <label for="viewfile">指定风格</label> </dt> <dd class="opt"> <input type="text" name="viewfile" id="viewfile" value="{$tag.viewfile}" class="input-txt"> <p class="notic">只要填写风格名称即可不包含.htm类型,比如:tagindex</p></dd></dl> |
保存。
4、在phpmyadmin里增加字段viewfile,执行下面SQL语句,重启Mysql。
5、效果及使用方法


以上就是速优网络和大家分享的"Eyoucms自定义tag模板风格的方法",非常感谢您有耐心的读完这篇文章,我们将为您提供更多参考使用或学习交流的信息。我们还可为您提供:企业网站建设、网站仿制、网站复制、仿站、外贸网站建设、外贸建站、公司官网制作等服务,本公司以“诚信、专业、务实、创新”的服务理念服务于客户。如您需要合作,请扫码咨询,我们将诚挚为您服务。
TAG标签:易优cms