In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Editor to share with you the method of using dedecms feature template, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
How to use the dedecms feature template?
There is relatively little information related to the topic of DeDeCms on bbs. We have consulted a lot of materials before, but we have not found its solution.
Recommended study: dream weaving cms
Wunai can only rely on self-made food and clothing; there is a passage in the official version:
1. If the list of articles is separated in the form of ID1,ID2,ID3, the system will automatically exclude the same articles from different nodes.
2. For the use of the [field:fieldname /] tag in a single record template, please refer to the instructions on the arclist tag in the system help.
3. The node ID is the unique identity of the node, which allows the {dede:specnote id=' logo'/} to represent a single node in the theme template.
4, under normal circumstances, each node displays the document in the "Node article list". If you specify the "automatic acquisition mode", then you must specify the keyword and column ID.
However, the test {dede:specnote id=' logo'/} this did not improve; so we began to solve this to replace the original relatively rigid {dede:field name='note'/} tag
Examples are as follows:
I want to display articles with different nodes in two columns. At present, it cannot be realized with "note". It can only be divided into columns with the same node, which inevitably seems awkward and inflexible.
Next, I will write down my solution for students' reference. First of all, I have to make it clear that it can only achieve the function, but the algorithm is not necessarily the best, because I am not very familiar with the DEDECMS code and have not studied it carefully. I hope you Haihan!
Step 1:
File location: {include/inc_archives_view.php}
The code is as follows:
/ / Advertising tag / /-else if ($ctag- > GetName () = = "myad") {$this- > dtp- > Assign ($tagid,$this- > PartView- > GetMyAd ($typeid,$ctag- > GetAtt ("name"));} / / thematic logo / / by phpfanselse if ($ctag- > GetName () = = "specnote") {$this- > dtp- > Assign ($tagid,$this- > ChannelUnit- > GetSpecList ('', $this- > ChannelUnit- > specrule,$ctag- > GetAtt ("id"));}
Introduction: {add a feature logo under the ad tag} so that the feature article list page can identify the specnote tag
Step 2:
File location: {include/inc_channel_unit.php}
Var $specrule;//-//php5 constructor / /-
Introduction: added the definition of $pecrule variable
Step 3:
File location: {include/inc_channel_unit.php}
The code is as follows:
Else if ($ftype== "specialtopic") {$this- > specrule = $fvalue;$fvalue = $this- > GetSpecList ($fname,$fvalue);}
Introduction: the sentence $this- > specrule = $fvalue; is added here to get the note field data of the addonspec table
Step 4:
File location: {include/inc_channel_unit.php}
The code is as follows:
/ / get a list of feature articles / /-- function GetSpecList ($fname,$noteinfo,$noteid= ") {if (! isset ($GLOBALS ['_ SpGetArcList'])) require_once (dirname (_ _ FILE__)." / inc/inc_fun_SpGetArcList.php "); if ($noteinfo==") return"; $rvalue = ""; $tempStr = GetSysTemplets ("channel/channel_spec_note.htm") $dtp = new DedeTagParse ()
$dtp- > LoadSource ($noteinfo); if (is_array ($dtp- > CTags)) {foreach ($dtp- > CTags as $k = > $ctag) {$notename = $ctag- > GetAtt ("name"); if ($noteidforth = "& & $ctag- > GetAtt (" noteid ")! = $noteid) {continue;} / / thematic node if ($noteidbath =" & $ctag- > GetAtt ("noteid") = = $noteid) {$isauto = $ctag- > GetAtt ("isauto"); $idlist = trim ($ctag- > GetAtt ("idlist")) $rownum = trim ($ctag- > GetAtt ("rownum")); if (empty ($rownum)) $rownum = 40 rownum = ""; $stypeid = 0
If ($isauto==1) {$idlist = ""; $keywords = trim ($ctag- > GetAtt ("keywords")); $stypeid = $ctag- > GetAtt ("typeid");}
If (trim ($ctag- > GetInnerText ())! = ") $listTemplet = $ctag- > GetInnerText (); else $listTemplet = GetSysTemplets (" spec_arclist.htm "); $idvalue = SpGetArcList ($this- > dsql,$stypeid,$rownum,$ctag- > GetAtt (" col "), $ctag- > GetAtt (" titlelen "), $ctag- > GetAtt (" infolen "), $ctag- > GetAtt (" imgwidth "), $ctag- > GetAtt (" imgheight ")," all "," default ", $keywords,$listTemplet,100,0,$idlist)
$notestr = str_replace ("~ notename~", $notename,$tempStr); $notestr = str_replace ("~ spec_arclist~", $idvalue,$notestr); $rvalue. = $notestr;if ($notebook = "& & $ctag- > GetAtt (" noteid ") = = $noteid) {break;}} $dtp- > Clear (); return $rvalue;}
Introduction: some small changes, their own comparison will be clear, here will no longer shiver
Step 5:
Note: the original {dede:field name='note'/} tag is invalid, if you want to use it, please modify the four parts of the steps yourself. no, no, no.
The above is all the content using the method of dedecms project template, thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.