星联网络专注帝国CMS二次功能插件开发-精品网站模板站长代码素材

  • 最近更新
  • 模板:33
  • 记录:12641|
  • 插件:52|
  • 工具:4|
  • 代码:8|
  • 评论:0

织梦dede怎么调用指定的文章

前言

本文主要讲解《织梦dede怎么调用指定的文章》的详细内容

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

在网站中调用指定文章可以使用织梦默认的标签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}

如果这样调用不出来文章的话就可以试试下面的方法:

打开include\inc_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’),就行了
打开incclude\inc\inc_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}

本网刊登的文章均仅代表作者个人观点,并不代表本网立场。文中的论述和观点,敬请读者注意判断。

本文地址:http://www.xlkjgs.com/notes/web/8174.html

以上内容由本站整理呈现,请务必在转载分享时注明本文地址!如对内容有疑问,请联系我们,谢谢!

星联网络

星联网络是中国最具实战的互联网创业者的知识服务商,这里有互联网行业动态,网络推广,SEO优化,SEM优化,ESC配置,行业经验分型,互联网项目,微信营销、淘宝客赚钱、新媒体营销、京东运营、跨境电商等众多互联网营销知识分享

站长运营站长必备网站运营之道才能长久发展