Home >CMS Tutorial >DEDECMS >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.
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.
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}
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!