VPS参考测评推荐
专注分享VPS主机优惠信息
衡天云优惠活动
华纳云最新优惠促销活动
jtti最新优惠促销活动

如何使用dededcms主题模板(如何在dededcms中使用模板建立网站)

locvps
主机参考:VPS测评参考推荐/专注分享VPS服务器优惠信息!若您是商家可以在本站进行投稿,查看详情!此外我们还提供软文收录、PayPal代付、广告赞助等服务,查看详情!
我们发布的部分优惠活动文章可能存在时效性,购买时建议在本站搜索商家名称可查看相关文章充分了解该商家!若非中文页面可使用Edge浏览器同步翻译!PayPal代付/收录合作

如何使用dededcms主题模板(如何在dededcms中使用模板建立网站)

如何使用dedecms专题模板?

bbs上关于DeDeCms的信息相对较少,之前查阅了大量信息但没有找到解决方案。

推荐学习:梦想编织cms

除了自己能吃饱穿暖,别无他求;在官方版本中,有这样一段话:

1.文章列表以ID1、ID2、ID3的形式分离,系统会自动排除不同节点的相同文章;

2.关于【field:fieldname /】标签在单个记录模板中的使用,请参考系统帮助中关于arclist标签的说明;

3.节点ID是节点的唯一标识符,允许使用{ dede:spec note ID =‘identifier‘/}来表示主题模板中的单个节点。

4.正常情况下,每个节点显示“节点文章列表”中的文档。如果指定“自动采集模式”,则必须指定关键字和列ID。

然而,在测试{ dede:spec note id =‘logo‘/}后,这并没有取得成效;所以我开始解决这个问题,以取代原来死板的{ dede:field name =‘note‘/}标签。

例如:

我想将不同节点的文章分两列显示,目前使用“笔记”无法实现。它只能划分到同一节点的列中,这难免有点尴尬和不灵活。

我将写下自己的解决方案供学生参考。首先我得声明一下,功能只能实现,但算法不一定是最好的,因为我不熟悉DEDECMS代码,也没有仔细研究过。希望大家坦诚相待!

第一步:

文件位置:{ include/Inc _ archives _ view . PHP }

代码如下:

//广告标记//-else if($ ctag-》getname()= =“myad“){ $ this-》DTP-》Assign($ tagid,$ this-)}//主题标识//by PHP fans else if($ ctag-》getname()=“spec note“){ $ this-》DTP-》Assign($ tagid,$ this-》channel unit-》getSpeclist(& # 39;',$ this-》channel unit-》spec rule,$ ctag-》GetAtt(“));}简介:{在广告标签下添加特殊标志}以便特殊文章列表页面可以识别specnote标签。

第二步:

文件位置:{include/inc _ channel _ unit.php}

var $ specrule// -简介:添加了$pecrule变量的定义。

第三步:

文件位置:{include/inc _ channel _ unit.php}

代码如下:

else if($ ftype = =“special topic“){ $ this-》spec rule = $ f value;$ fvalue = $ this-》GetSpecList($ fname,$ fvalue);}简介:此处添加$ this-》spec rule = $ f value;这句话,为了获取addonspec表的note字段数据;

第四步:

文件位置:{include/inc _ channel _ unit.php}

代码如下:

//获取特殊文章列表///函数getspeclist($ fname,$ noteinfo,$ noteinfo =““){ if(!isset($ GLOBALS【& # 39;_ _ SpGetArcList & # 39】))require _ once(dirname(_ _ FILE _ _)。“/Inc/Inc _ fun _ spgetarclist . PHP“);if($ note info = =““)返回““;$ rvalue =““;$ tempStr = GetSysTemplets(“channel/channel _ spec _ note . htm“);$ DTP = new DedeTagParse();

$ DTP-》load source($ note info);if(is _ array($ DTP-》CTags){ foreach($ DTP-》CTags as $ k =》$ ctag){ $ notename = $ ctag-》GetAtt(“name“);if($ note id!=““& & $ ctag-》GetAtt(“note id“)!= $ note id){ continue;}//主题节点if($ note id!=““& $ ctag-》GetAtt(“noteid“)= = = $ noteid){ $ isauto = $ ctag-》GetAtt(“isauto“);$ id list = trim($ ctag-》GetAtt(“id list“));$ rownum = trim($ ctag-》GetAtt(“rownum“);if(empty($ rownum))$ rownum = 40;$ keywords =““;$ stype id = 0;

if($ is auto = = 1){ $ id list =““;$ keywords = trim($ ctag-》GetAtt(“keywords“);$ stypeid = $ ctag-》GetAtt(“typeid“);}

if(trim($ ctag-》GetInnerText())!=“““)$ list templet = $ ctag-》GetInnerText();else $ list templet = GetSysTemplets(“spec _ arclist . htm“);$ id value = SpGetArcList($ this-》dsql,$stypeid,$rownum,$ ctag-》GetAtt(“col“),$ ctag-》GetAtt(“title len“),$ ctag-》GetAtt(“infolen“),$ ctag-》GetAtt(“imgwidth“),$ ctag-》GetAtt(“img height“,“all““default“,$keywords

$ notestr = str _ replace(“~ notename ~“$ notename,$ tempStr);$ notestr = str _ replace(“~ spec _ arclist ~“,$idvalue,$ notestr);$rvalue。= $ notestrif($ note id!=““& & $ ctag-》GetAtt(“noteid“= = $ noteid){ break;} } } } $ DTP-》Clear();返回$ rvalue简介:有一些细微的变化,如果你自己比较一下就会很清楚,所以这里不会再瑟瑟发抖了。

第五步:

注意:原始的{ dede:field name =‘note‘/}标记无效。如果要使用,请自行修改四个步骤。。

很简单;

搞定了。

以上是如何使用dedecms专题模板的详细信息。更多资讯请关注主机参考其他相关文章!

这几篇文章你可能也喜欢:

本文由主机参考刊发,转载请注明:如何使用dededcms主题模板(如何在dededcms中使用模板建立网站) https://zhujicankao.com/99047.html

【腾讯云】领8888元采购礼包,抢爆款云服务器 每月 9元起,个人开发者加享折上折!
打赏
转载请注明原文链接:主机参考 » 如何使用dededcms主题模板(如何在dededcms中使用模板建立网站)
主机参考仅做资料收集,不对商家任何信息及交易做信用担保,购买前请注意风险,有交易纠纷请自行解决!请查阅:特别声明

评论 抢沙发

评论前必须登录!