zoukankan      html  css  js  c++  java
  • 织梦CMS如何在首页调用指定的文章 idlist

    在网站首页调用站内新闻是必不可少的,但是有的时候不能根据自己的需要来调用指定的文章,想要调用自己指定的文章还要做一些修改。

    在网站中调用指定文章可以使用织梦默认的标签idlist,在调用的时候使用以下代码:
    {dede:arclist idlist='13' limit='0,1' infolen='60'}
    <span><a href="[field:arcurl/]" target="_blank">[field:title/]</a></span>
    <span>[field:infos/]<a href="[field:arcurl/]" target="_blank">[详细]</a></span>
    {/dede:arclist}
    如果这样调用不出来文章的话就可以试试下面的方法:
    打开includeinc_arcpart_view.php文件
    找到第function ParseTemplet();这一个函数里面的
    $this->dtp->Assign($tagid,
    $this->GetArcList($typeid,$ctag->GetAtt("row"),$ctag->GetAtt("col"),
    $titlelen,$infolen,$ctag->GetAtt("imgwidth"),$ctag->GetAtt("imgheight"),
    $ctag->GetAtt("type"),$orderby,$ctag->GetAtt("keyword"),$innertext,
    $ctag->GetAtt("tablewidth"),0,"",$channelid,$ctag->GetAtt("limit"),$ctag->GetAtt("att"),
    $ctag->GetAtt("orderway"),$ctag->GetAtt("subday"),$autopartid,$ctag->GetAtt("ismember")
    )
    将里面的0改为$ctag->GetAtt(‘arcid’),就行了
    打开inccludeincinc_fun_spgetarclist.php文件
    找到
    〔if($arcid!=0) $orwhere .= " And arc.ID<>'$arcid' ";〕
    替换成:
    if($arcid!=0) $orwhere .= " And arc.ID='$arcid' ";
    if($arcid==0) $orwhere .= " And arc.ID<>'$arcid' ";
    在使用调用代码的时候使用如下代码:
    {dede:arclist arcid='13' row='5' col='1' titlelen='24' }
    <table>
    <tr>
    <td>[field:title/]
    [field:info/]</td>
    </tr>
    </table>
    {/dede:arclist}
  • 相关阅读:
    SimpleAdapter的用法
    ListView中加载大量的图片
    用PreferenceActivity做一个标准的设置界面
    用代码构造PreferenceScreen
    工具类之Condition
    工具类之Mutex
    Linux初探之如何查看帮助文档自学命令[网址]
    linux基础之帮助文档---常用的命令[转载]
    Linux 下常见的四款chm查看器比较[转载+亲测可用]
    Linux(Ubuntu)下MySQL的安装与配置[转载+亲测]
  • 原文地址:https://www.cnblogs.com/tanlingdangan/p/3800730.html
Copyright © 2011-2022 走看看