帝国cms网站模板调用标签大全

帝国CMS是常用的建站系统,其模板调用标签功能强大。本文整理了该系统通用、首页、列表页、内容页等场景下的常用标签,涵盖域名替换、TDK优化、内容调用等操作,附详细代码示例,为开发者提供实用参考,助其高效完成网站模板开发与功能拓展。

通用

全站域名替换标签

<link href="[!--news.url--]skin/static/css.css" rel="stylesheet">

空链接

<a href="javascript:void(0)"></a>

新窗口打开

<a href="/" target="_blank"></a>

首页

首页TDK调用

<title>[!--pagetitle--]</title>
<meta name="keywords" content="[!--pagekey--]" />
<meta name="description" content="[!--pagedes--]" />

调用指定id内容(带链接/图片/标题/描述/日期)- 灵动标签

[e:loop={'select * from [!db.pre!]ecms_news where id in(id1,id2,id3)',1,24,0}]
       <li><a href="<?=$bqsr[titleurl]?>" target="_blank"><i><img src="<?=$bqr[titlepic]?>"></a></i>
         <h3><?=$bqr[title]?></h3>
         <p><?=esub($bqr[smalltext],200)?></p>
         <time><?=date("Y-m-d",$bqr[newstime])?></time>
       </li>
[/e:loop]

调用指定id内容 - 灵动标签

[e:loop={'select * from [!db.pre!]ecms_news where id in(id1,id2,id3)',1,24,0}]
       <li><a href="<?=$bqsr[titleurl]?>" target="_blank"><i><img src="<?=$bqr[titlepic]?>" alt="<?=$bqr[title]?>"></i>
       <p><?=$bqr[title]?></p></a>
       </li>
[/e:loop]

列表页

副标题调用

<?php 
        $cr=$empire->fetch1("select bname from greenstar_enewsclass where 
        classid='".$GLOBALS[navclassid]."' limit 1"); 
        echo $cr['bname']; 
        ?>

关键词描述调用

<meta name="keywords" content="[!--pagekey--]" />
<meta name="description" content="[!--pagedes--]" />

当前栏目内容列表调用

[!--empirenews.listtemp--]
     <!--list.var1-->
[!--empirenews.listtemp--]

          <li><a href="[!--titleurl--]" target="_blank">
            <i><img src="[!--titlepic--]" alt="[!--oldtitle--]"></i>
              <section>
                <h3>[!--oldtitle--]</h3>
                <p>[!--smalltext--]</p>
                <span>了解详情</span>
              </section>
            </a></li>

内容页

文章TDK调用

<title>[!--pagetitle--]</title>
<meta name="keywords" content="[!--pagetitle--]" />
<meta name="description" content="[!--smalltext--]" />

导航条调用

<div class="weizhi">当前位置:[!--newsnav--]</div>

内容标题/发布时间/浏览量调用

<h1 class="c_title">[!--pagetitle--]</h1>
        <div class="news_info">
           <p>时间:[!--newstime--]</p>
               <p>阅读:<script
                            src=[!--news.url--]e/public/ViewClick/?classid=[!--classid--]&id=[!--id--]&addclick=1></script>
                </p>
 </div>

内容正文调用

[!--newstext--]

上一篇下一篇调用

 <ul>
          <li>上一篇:[!--info.pre--]</li>
          <li>下一篇:[!--info.next--]</li>
 </ul>

根据SQL自定义字段调用相关文章

[e:loop={"select * from [!db.pre!]ecms_news where title like '%$navinfor[diaoqu1]%'
and id<>
    $navinfor[id] order by rand() limit 6",20,24,0}]
    <li><a href="<?=$bqsr['titleurl']?>" target="_blank">
            <section>
                <h3 style="font-weight: 400;font-size: 16px;"><?=$bqr['title']?></h3>
                <p><?=esub($bqr[smalltext],200)?></p>
                <span>了解详情</span>
            </section>
        </a>
    </li>
    [/e:loop]

根据SQL自定义字段并指定id栏目调用相关文章

[e:loop={"select * from [!db.pre!]ecms_news where classid=4 and title like '%$navinfor[diaoqu1]%'
and id<>
    $navinfor[id] order by rand() limit 6",20,24,0}]
    <li><a href="<?=$bqsr['titleurl']?>" target="_blank">
            <section>
                <h3 style="font-weight: 400;font-size: 16px;"><?=$bqr['title']?></h3>
                <p><?=esub($bqr[smalltext],200)?></p>
                <span>了解详情</span>
            </section>
        </a>
    </li>
    [/e:loop]

声明:本文由迟博勋独家编辑,如若转载,请注明出处:https://www.chiboxun.com/198.html

(0)
迟博勋的头像迟博勋

相关推荐

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

公众号