What is the basic usage method of the AnQiCMS friendship link tag (linkList)?

Calendar 👁️ 94

As an experienced website operations expert, I fully understand the importance of friend links in the website ecosystem.They are not only potential entry points for external traffic, but also an indispensable part for enhancing the authority of the website and improving search engine rankings (SEO).AnQiCMS as a highly SEO and user experience focused content management system, naturally provides an intuitive and powerful management tool for link exchange.Today, let's delve deeply into the friend link tag in AnQiCMS——linkListThe basic usage method of ——.

When you need to display friend links on the website front-end, AnQiCMS provides a namedlinkListThe dedicated template tag. Its core function is to pass all the friendship link data meticulously configured in the background to the front-end template in an easy-to-handle variable form, allowing you to flexibly control their display method.

linkListcore function and basic usage of the tag

linkListTags will collect the background friend link data into a variable, usually we will name itfriendLinksBut this is not mandatory, you can also name it with your own preference, for examplelinksorexternalLinks. Since friendship links are usually displayed in a list format, we need to use the loop structure of the template engine to present these data one by one.

Let's understand through a typical code example.linkListThe practical application:

{% linkList friendLinks %}
{% if friendLinks %}
<div class="footer-links">
    <h3>友情链接</h3>
    <ul class="friend-list">
    {% for item in friendLinks %}
        <li><a href="{{item.Link}}" {% if item.Nofollow == 1 %} rel="nofollow"{% endif %} target="_blank">{{item.Title}}</a></li>
    {% endfor %}
    </ul>
</div>
{% endif %}
{% endlinkList %}

This code first goes through{% linkList friendLinks %}The tag retrieves friend link data and assigns it tofriendLinksThe variable. Subsequently, a{% if friendLinks %}Ensure that the relevant HTML structure is rendered only when there is a friendship link, to avoid the page appearing empty.

In the loop, we use{% for item in friendLinks %}Traverse each friendship link. HereitemRepresents the single friendship link object currently in the loop, it contains the following key fields, which can be called in the template:

  • item.TitleThis is the display name of the friendship link, for example, 'AnQi CMS Official Website' or 'Excellent Blog'. This is the link text that users see on the website.
  • item.LinkThis points to the complete URL address of the friendship link, for examplehttps://en.anqicms.com/When the user clicks the link, they will be redirected to this address.
  • item.RemarkThis is the remark information of the friend link, which is usually not directly displayed on the front-end, but can help you better identify and classify links in the back-end management.
  • item.NofollowThis is a very important SEO attribute. Whenitem.NofollowThe value is1it indicates that the link is set torel="nofollow", telling search engines not to follow this link or pass on any authority. If the value is0Or not existing, it means it is a normal link. In the above example, we cleverly use conditional judgment{% if item.Nofollow == 1 %}to dynamically addrel="nofollow"Property.

Flexible parameters: Multi-site call

in most cases,linkListThe label does not require any additional parameters to meet your needs. It will automatically retrieve all the friendship links configured in the background of the current site.However, if you are operating a multi-site AnQiCMS environment and need to call the friend link data across sites, then you can usesiteIdThe parameter is used to specify the ID of the target site. For example,{% linkList friendLinks with siteId="2" %}It will retrieve the list of friend links for the site with ID 2. This provides great flexibility for multi-site operations.

Seamless connection between backend management and frontend display

All these links' addition, editing, and management are performed in the AnQiCMS backend under the 'Function Management' menu and the 'Friend Links' module. Here you can set the title, URL, notes, and whether to add each linknofollowProperty. The intuitive operation on the back-end ensures that you can easily maintain these important external resources, while the front-endlinkListtags are responsible for safely and efficiently presenting this data on your website.

Rational utilizationlinkListTags can not only effectively improve the SEO performance of the website, but also provide users with more valuable external resources, enhance the authority and user stickiness of the website.Place it in the website footer, sidebar, or a dedicated 'friend links' page, and it can effectively play its role.By using the powerful template engine of AnQiCMS, you can customize a unique display effect for the friend links according to the overall design style of the website.

Frequently Asked Questions (FAQ)

How to add and manage friend links in AnQiCMS backend?

You can log in to the AnQiCMS backend and find the 'Function Management' menu through the left navigation bar. Click on the 'Friend Link' option in the submenu. After entering the Friend Link management page, you can click the 'Add Friend Link' button to add a new link, or edit, delete existing links, and set the title, URL, remarks, and whether to use for each link.rel="nofollow"Property.

2. Why is my friend link not showingrel="nofollow"?

Is my friend link showing?rel="nofollow"The attribute depends on whether you have checked the corresponding option when editing the link on the AnQiCMS backend. At the template level,linkListTags provideditem.Nofollowthe field has a value1(When selected as nofollow), you need to use conditional judgment in the template code (such as{% if item.Nofollow == 1 %} rel="nofollow"{% endif %})to dynamically output this property. If it is not checked on the backend, or the corresponding judgment logic is not written in the template,nofollowthe property will not be displayed.

3. Can I display the website logo or icon in the friend link list?

linkListThe fields provided by the default tags includeTitle/Link/RemarkandNofollowThere is no field directly provided for Logo or icon. If you want to display a Logo, there are usually two implementation methods:

a. **在链接标题中包含 `<img>` 标签:** 在后台添加友情链接时,直接将Logo的 `<img>` 标签代码写入“链接名称”字段。例如:`<img src="/path/to/logo.png" alt="AnQiCMS"> AnQiCMS官网`。这种方式简单直接,但后台管理界面可能显示为HTML代码。
b. **利用备注字段或自定义字段:** 在后台友情链接的“备注”字段中填写Logo的URL,或者如果AnQiCMS支持为友情链接模型添加自定义字段,您可以添加一个专门用于Logo URL的字段。然后,在前端模板中,您可以解析 `item.Remark` 或自定义字段的内容来显示图片。这需要一些额外的模板处理逻辑。

Related articles

How to optimize the performance of multilingual sites using Go language features?

AnQiCMS as an enterprise-level content management system built with Go language, has shown unique advantages in optimizing the performance of multilingual websites.For many companies or content operation teams that hope to expand into the international market, the performance of multilingual websites is crucial.A slow-loading, unresponsive multilingual site not only affects user experience but may also lead to the loss of potential customers and a decline in search engine rankings.AnQi CMS precisely grasps this core pain point, utilizing the many features of the Go language to provide solid technical support for the smooth operation of multilingual sites

2025-11-06

How does AnQiCMS's multilingual support enhance the website experience for global users?

How does the multilingual support of AnQiCMS enhance the website experience for global users?In today's rapidly developing digital age, enterprises and content creators are increasingly aware of the importance of the global market.A website that can cross language barriers, not only can reach a wider user base, but is also the key to building an international brand image and enhancing user trust.AnQiCMS (AnQiCMS) is well-versed in this, and its built-in powerful multilingual support feature is designed to solve this pain point, aiming to provide global users with seamless, localized website experiences

2025-11-06

How does the AnQiCMS multi-site content model adapt to the needs of content structures in different languages?

## Tackling globalization of content: How does AnQi CMS multi-site content model adapt to the needs of different language content structures?In the wave of globalization, businesses and content operations teams are facing the challenge of providing accurate and high-quality content for audiences in different regions and languages.This is not just simple translation, but also about how to flexibly adjust the presentation and underlying structure of content according to regional culture, market habits, and even laws and regulations.

2025-11-06

How to implement unified static resource management and acceleration in AnQiCMS multi-site?

## In AnQiCMS multi-site to achieve unified static resource management and acceleration

2025-11-06

How to correctly call the friend link list on the homepage or specified page of AnQiCMS website?

As an experienced website operations expert, I am well aware of the importance of friendship links to the website.They are not only effective means to improve the performance of search engine optimization (SEO), but also a way to expand cooperation and increase the authority of the website.In AnQiCMS (AnQi CMS), managing and calling friend links is a very intuitive and flexible process that can help you easily display these valuable external resources on the homepage or other specified pages.### Management and value of friendship links in AnQiCMS Before starting the front-end display

2025-11-06

What data structure does the variable `friendLinks` represent in `{% linkList friendLinks %}`?

As an experienced website operations expert, I fully understand the crucial role of an efficient content management system in the success of a website.AnQiCMS (AnQiCMS) provides great convenience for operators with its flexible template engine and rich features.Today, let's delve deeply into a commonly used and crucial tag in the AnQiCMS template: `{% linkList friendLinks %}`, especially the data structure represented by the `friendLinks` variable, and how to make full use of it to optimize your website.### Decrypt

2025-11-06

How to get the text name (Title) of each link when looping through the friendship link tags?

As an experienced website operations expert, I know that how to flexibly use template tags to display content in a high-efficiency content management system like AnQiCMS is the key to improving website operation efficiency.Friend links are an indispensable part of website external communication and SEO optimization, and their dynamic display often requires us to accurately obtain the text names of each link from the loop output.Today, let's delve deeply into how to elegantly implement this feature in AnQiCMS.

2025-11-06

How to extract the URL address (Link) from the friendship link tag?

## Unveiling AnQi CMS friendship link: Practical guide on how to efficiently obtain and use website link URLIn AnQi CMS, such an efficient and customizable Go language content management system, how to flexibly manage and extract the URL addresses of these links is a focus of many operators.

2025-11-06