search
HomeCMS TutorialDEDECMSHow to implement dedecms friendly link sub-column call

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}

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!

Statement
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools