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

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

在网站中调用指定文章可以使用织梦默认的标签idlist,在调用的时候使用以下代码:

{dede:arclist idlist='13' limit='0,1' infolen='60'}

[field:title/]

[field:infos/][详细]

{/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' }

[field:title/]

[field:info/]

{/dede:arclist}

(责任编辑:最模板)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值