In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces the method of making a single page of dream weaving, which is very detailed and has a certain reference value. Interested friends must finish reading it!
How to weave dreams on a single page?
We know that the template call tag for a single page of content is {dede:field.content/}. After experiments, it is used on the home page. Because of the limitations of this method, we can also use SQL to call, which greatly improves the flexibility, and can call the single page content of any column ID.
The code is as follows:
{dede:field.content/}
This tag system only supports calling in the column template, not in the content template. If you want the content template to support it, it's actually very simple. Just add a line of code to the archives.class.php in the core directory, include/, and OK.
The copy code is as follows:
$this- > Fields ['content'] = $this- > TypeLink- > TypeInfos [' content']; / / add this code on line 86
How to call the column content that has been made into a single page to the front page.
The commonly used single page content that needs to be transferred to the home page, such as company profile, contact us, etc., we may have to show it on the home page. Through the conventional way, including access to the official dede forum materials, can not find a more appropriate answer. Today we will provide two ways to make calls.
First, we know that the template call tag for a single page of content is {dede:field.content/}. After experiments, it is used on the home page.
The code is as follows:
{dede:channelartlist} {dede:field.content/} {/ dede:channelartlist}
Call, you can call up the relevant data smoothly.
However, there is a problem, this call can only be used in the case of only one single page, if the system contains two or more single pages, the call will stack all the single page content. It doesn't work even if you add type's ID to qualify. So this method is not very suitable.
Second, we can also use SQL to make calls, which makes it much more flexible and can call the single-page content of any column ID.
The code is as follows:
{dede:sql sql='Select content from dede_arctype where id=1'} [field:content/] {/ dede:sql}
If you want to call that column, you only need to modify the ID of the column; but it is important to note that the "dede_arctype" table name should be filled in according to the table name when you installed the system, otherwise it will not be called.
But sometimes we do not need to show all the text of a column, all need to intercept part of the home page, so how to achieve, look at the code, or use sql to intercept the called data.
For example: Select content,substring (content,1280) as content from dede_arctype where id=1
This sentence means to cut out 1-280 characters from the content of the ID1 column.
The above is all the content of the method of weaving dream single page, thank you for your reading! Hope to share the content to help you, more related 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.