Eyoucms自定义tag模板风格的方法

2023-12-14 10:48 小编

eyoucms自定义tag模板风格的方法来自小秋姑娘。

涉及的修改文件:

1、application\home\controller\tags.php文件

找到:

1
2
3
if (!empty($tagindexInfo)) {  
 $tagid $tagindexInfo['id'];
 $tag $tagindexInfo['tag'];

下面增加:

1
$viewfile $tagindexInfo['viewfile'];

找到:

1
2
3
 $field_data array(
 'tag'   => $tag,
 'tagid'   => $tagid,

下面增加:

1
'viewfile' => $viewfile,

找到:

1
2
/*模板文件*/
 $viewfile 'lists_tags';

改为:

1
2
3
4
5
6
7
8
/*模板文件*/
if($viewfile) {
    $viewfile $viewfile;
}
else
{
    $viewfile 'lists_tags';
}

保存。


2、application\admin\controller\Tags.php

找到

1
2
3
4
5
6
7
8
9
10
11
/**     * 编辑
     */    
    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'] : '',

下面增加

1
'viewfile' => !empty($post['viewfile']) ? $post['viewfile'] : '',


3、application\admin\template\tags\edit.htm

找到

1
2
3
4
5
6
7
8
9
10
11
12
<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>

下面增加

1
2
3
4
5
6
7
8
9
<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。

Eyoucms自定义tag模板风格的方法(图1)1-200Q6122959641.zip


5、效果及使用方法

Eyoucms自定义tag模板风格的方法(图1)


在线咨询 拨打电话

电话

13363039260

微信二维码

微信二维码