Home > CMS Tutorial > DEDECMS > body text

How to implement dedecms friendly link sub-column call

藏色散人
Release: 2019-12-14 10:52:52
Original
2362 people have browsed it

How to implement dedecms friendly link sub-column call

How to call dedecms friendly links in different columns?

dedecmsHow to call different friendly links on different column pages. I searched online for a long time, and all of them talked about how to call the homepage and column pages respectively. Let me share with you a little trick and why it is implemented in this way. There is no need to say more about the reasons.

Recommended learning: 梦Weavercms

In fact, using object and javascript to call external files can also call different friendship links in different columns, which is equivalent to calling friendship in different columns. Link file, {dede:field.typeid/} to get the ID of the current column. When calling friendly links through this method, it is considered friend link deception and is not recommended. The tags of dedecms cannot be applied (except Channelartlist), which brings some trouble to the implementation, but there is another tag that can help, the sql tag. The specific operation is as follows:

1. Backend-Core-Website Column Manage and record the column name and column ID.

How to implement dedecms friendly link sub-column call

2. Backend-Module-Friendly Links-Website Type Management, edit the website type to make the website type name and ID consistent with the column name and ID.

How to implement dedecms friendly link sub-column call

3. In the column template, write the following code:

dede:sql sql="select url,webname from dede_flink where id = (select id from dede_flinktype where typename=~typename~)" }<a href="[field:url/]">[field:webname/]</a>{/dede:sql}
Copy after login

4. As for the homepage link, you can directly enter it in the website type management Add a "Homepage", and then directly add typeid='Website Type ID' in the homepage template

You're done! It's very simple, but I couldn't find it online. This situation is suitable for sites with few columns. If there are more columns, it will look a bit stupid. It can also be achieved through secondary development of PHP. Here is a simple sharing and backup with everyone.

The above is the detailed content of How to implement dedecms friendly link sub-column call. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template