In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
This article will explain in detail the method of calling single-page document content on the home page of weaving dreams. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.
How does the dream-weaving home page call the content of a single-page document?
Dream weaving DEDECMS home page calls single page document content
The implementation method of calling single-page document content on the home page of dream weaving DedeCMS is as follows:
{dede:sql sql= "SELECT body FROM `dede_ sgpage` where aid = 3"} [field:body function= "htmlspecialchars (cn_substr (@ me,100))" /] {/ dede:sql}
Where:
{dede:sql sql= "SELECT body FROM `dede_ sgpage` where aid = 3"}
The body in sql= "SELECT body" is the content of the article.
FROM `dede_ sgpage` the dede_sgpage here is the data table archived by a single-page document. This is Zhimeng 5.6. Other versions need to be defined according to the name of the table.
Where aid = 3 "here aid = 3 is the id where our single-page document is located. If we need to call the content of a single-page document, just replace this with the id of the document we are in!
[field:body function= "htmlspecialchars (cn_substr (@ me,100))" /]
Field:body the body here is also the content of the article.
(cn_substr (@ me,100) the 100th here is the number of words we want the content to display, and this can be adjusted.
If you do this, you will find that there is a problem, and the html has also been called. We need to filter it out in the following way:
{dede:sql sql= "SELECT body FROM `sgpage` where aid = 3"} [field:body function= "htmlspecialchars (cn_substr (Html2text (@ me), 100)" /] {/ dede:sql}
The function Html2text () is the code to remove the html tag.
The function cn_substr (str,100) intercepts the length of the string.
So we can call the contents of a single-page document.
About weaving dream home page calls the method of single-page document content to share here, hope that the above content can have some help to everyone, can learn more knowledge. If you think the article is good, you can share it for more people to see.
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.