In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Dream weaving message board calls the method of the template head and bottom? This problem may be often seen in our daily study or work. I hope you can gain a lot from this question. The following is the reference content that the editor brings to you, let's take a look at it!
Dream weaving message board how to call the template head and bottom?
Dream weaving DEDECMS message board calls the method at the head and bottom of the template
Recommended study: dream weaving cms
As we all know, DEDE's message board is independent and does not look very beautiful. Many people want to implement the dede tag call in the guestbook guestbook.htm, but the problem is that the dede tag is not supported in plus. It is troublesome to modify the message board to be consistent with other pages, because many of the original calls cannot be used. Here are two simple ways to call the site's unified header and bottom template: one is to customize the macro tag, and then use JS to call; the other is the php method to call the original template.
Method 1: add a head tag to the custom tag and call the tag with JS: (recommended method 1)
Step 1: click "Custom Macro tag" in "template"
Step 2: add a macro tag and fill in {dede:include filename= "head.htm" /} in the tag content
Step 3: save the tag and return to the custom tag list, and click JS to get the JS calling code:
This JS code is equivalent to {dede:include filename= "head.htm" /} in a normal document. We can just use this js call code and paste it to the location where / templets/plus/guestbook.htm wants to call the message board header file.
Step 4: similarly, the method of calling the template at the bottom of the message board is the same.
Method 2: the method of php calling the original template
Step 1: open "/ include/common.func.php"
Then add a function to the file with the following code:
Function pasterTempletDiy ($path) {require_once (DEDEINC. "/ arc.partview.class.php"); global $cfg_basedir,$cfg_templets_dir;$tmpfile = $cfg_basedir.$cfg_templets_dir. "/". The path of the $path;// template file $dtp = new PartView (); $dtp- > SetTemplet ($tmpfile); $dtp- > Display ();}
The second step is to open the template file of the message book. The default is / templets/plus/guestbook.htm
Replace the original call header code with the following code:
The default here is the default template path. If you use other templates, please modify the default here.
Similarly, replace the bottom code of the call for the reason with the following code:
In this way, you can directly use the head and footer templates of the system!
Thank you for reading! After reading the above, do you have a general understanding of the method of calling the head and bottom of the template on the dream message board? I hope the content of the article will be helpful to all of you. If you want to know more about the relevant articles, you are 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.