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

Calendar 👁️ 77

As an experienced website operation expert, I am well aware of the importance of friendship links for a 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 the friend link is a very intuitive and flexible process, which can help you easily display these valuable external resources on the homepage or other specified pages.

Management and value of friend links in AnQiCMS

Before starting the front-end display, we first need to understand how to manage the friend links in the AnQiCMS background.The design of AnQiCMS fully considers the needs of operators, providing a centralized and convenient backend management interface.Log in to the AnQiCMS admin interface, and you will find a "Friend Links" option under the "Function Management" module.Here, you can easily add, edit, or delete friend links.

Each friendship link can be configured with the following key information:

  • Link Name (Title): This is the name displayed on the website front-end for the friendship link, it should be clear and understandable.
  • Link Address: The URL of the target website, make sure it is accurate and error-free.
  • Remark for LinkAn internal note, convenient for you to manage and remember the source or cooperation details, usually not displayed on the front end.
  • Nofollow attribute (Nofollow)This is an extremely important SEO setting. When you check this option, AnQiCMS will add it to the links generated on the front end.rel="nofollow"This attribute tells the search engine not to pass the weight of the current page to the target website and not to track this link.Using Nofollow effectively can help manage the SEO weight flow of your website and avoid punishment for linking to low-quality or irrelevant websites.

AnQiCMS integrates the Nofollow attribute into the management interface, reflecting its deep understanding and support for modern SEO practices.The operator can flexibly decide whether to pass on weight based on the quality and relevance of the cooperative website, thereby better controlling the website's SEO strategy.

Correctly call the friend link list on the front end of the website.

Once the友情链接 link is configured in the background, the next step is to display them on your website. AnQiCMS provides a special template tag—linkListmaking this process extremely simple and efficient.linkListThe tag can retrieve all the configured friend links from the database and allows you to loop through them in any template file on the website.

linkListBasic usage of tags

linkListThe tag call is very intuitive. You need to specify a variable name to store the collection of friendship links obtained, for example, we can name itfriendLinks. The basic call structure is as follows:

{% linkList friendLinks %}
    {# 在这里放置循环代码来展示每个友情链接 #}
{% endlinkList %}

In{% linkList friendLinks %}and{% endlinkList %}Between, you can useforto loop throughfriendLinksEach item of the friendship link variable. Each loop item (such asitem) will contain the detailed information of the link, such as:

  • item.Title: Display name of the friend link.
  • item.Link: The target URL of the friendship link.
  • item.Remark: Link note (if to be displayed on the front end).
  • item.Nofollow: A boolean value (usually 1 for true, 0 for false), used to determine whether to add.rel="nofollow"Property.

A complete code example

Here is a typical code snippet that demonstrates how to call and display the friend link list in your AnQiCMS template. This code will intelligently add or not add the Nofollow attribute set in the background.rel="nofollow":

{% linkList friendLinks %}
    {% if friendLinks %} {# 首先判断是否有友情链接数据,避免空列表显示 #}
        <div class="friendship-links">
            <h2>友情链接</h2>
            <ul>
                {% for item in friendLinks %}
                    <li>
                        <a href="{{ item.Link }}"
                           {% if item.Nofollow == 1 %}rel="nofollow"{% endif %}
                           target="_blank"
                           title="{{ item.Remark if item.Remark else item.Title }}">
                            {{ item.Title }}
                        </a>
                    </li>
                {% endfor %}
            </ul>
        </div>
    {% endif %}
{% endlinkList %}

In this code block:

  • {% if friendLinks %}It is a good practice, which ensures that the entire friend link area will be rendered only when there is actual friend link data, avoiding the display of an empty title or container when there are no links.
  • href="{{ item.Link }}"The target address of the dynamically generated link.
  • {% if item.Nofollow == 1 %}rel="nofollow"{% endif %}Based on the backend configuration.NofollowAttribute value, added conditionally.rel="nofollow".
  • target="_blank": Typically used for friendship links, ensuring that it opens in a new tab without affecting the user's current browsing.
  • title="{{ item.Remark if item.Remark else item.Title }}"If the background has set a note, use the note as the link prompt text, otherwise use the link name.

Call on the specified page or home page

This code can be flexibly placed in any template file of your AnQiCMS website. The most common and recommended practice is to place it on the website'sFooter template (footer.html)in, it will be displayed at the bottom of all pages. If you need it on aspecific pageFor example, display an independent page or a single page such as "Friend Links", and simply insert the above code snippet into the corresponding template file of the page.

Furthermore,linkListThe tag also supports an optional parameter.siteIdParameters. If you are using the AnQiCMS multi-site management feature and want to call another site's friend link on the current site, you can use it like this:

{% linkList friendLinks with siteId="2" %}
    {# ... 循环展示代码 ... #}
{% endlinkList %}

Among themsiteId="2"Represents a link to the site with ID 2. This provides great convenience and flexibility for complex multi-site operations.

Operation suggestions

In addition to the correct technical call, as a website operator, you should also pay attention to the content quality and maintenance of the link exchange:

  1. Regular reviewCheck if the link is still active, the content is healthy, and avoid linking to invalid or harmful websites.
  2. Relevance: Choose friend links highly relevant to your website content, as this can bring more accurate traffic and is also beneficial for SEO.
  3. Moderate quantity: Not more is better for friendship links, quality is more important than quantity.

Frequently Asked Questions (FAQ)

Q1: Why did I add friendship links, but they are not displayed on the website?A1: There are usually several reasons. First, please make sure that you have successfully added the links under "Function Management" and "Friend Links" in the AnQiCMS background, and they are enabled.Secondly, check if you are in the corresponding template file (such as the homepage'sfooter.htmlor a dedicated friends link page template) was used correctlylinkListTemplate tags, and there are no spelling errors. If your website has enabled caching, try clearing the AnQiCMS background cache to ensure that the latest content can be loaded.

Q2:rel="nofollow"What is the use of this attribute, should I use it on all friend links?A2:rel="nofollow"The attribute tells the search engine not to pass the page ranking weight to the target link and not to track the link.Its main function is to control the SEO weight distribution of the website, avoiding search engine penalties that may arise from linking to irrelevant, low-quality, or paid links (ads).It is generally recommended to use all external links marked as 'non-editorial recommendations'nofollowFor example, advertisements, sponsored content, or friend links whose content quality and relevance you cannot fully guarantee. You can omit for high-quality, highly relevant and recognized cooperative websites.nofollowTo promote weight transfer and win-win cooperation. AnQiCMS backend provides check boxes for flexible control.

Q3: Do I want the friendship link list to look more beautiful, does AnQiCMS support custom styles?A3: Of course, it supports. AnQiCMS is a content management system mainly responsible for data management and output, while the appearance and style of the website are controlled by the HTML structure and CSS style sheet of the front-end template.You can in the abovelinkListThe HTML structure of the tag should have custom CSS classes added both externally and internally (for example, as shown in the example)friendship-links),Then write the corresponding style rules in your website CSS file to completely customize the display effect of the friend links list, so that it remains consistent with the overall design style of your website.

Related articles

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

As an experienced website operations expert, I fully understand the importance of friendship 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 is a content management system highly focused on SEO and user experience, naturally providing an intuitive and powerful management tool for link exchanges.Today, let's delve into the basic usage of the AnQiCMS friendship link tag——`linkList`.

2025-11-06

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

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

How to set the `rel="nofollow"` attribute in AnQiCMS友情 links to optimize SEO?

As an experienced website operations expert, I know that every detail can affect the performance of a website in the increasingly complex search engine optimization (SEO) environment.Friendship link, this seemingly simple function plays a role in SEO strategy that requires exquisite balance.Today, let's delve into how AnQiCMS helps us intelligently manage friend links and reasonably set the `rel="nofollow"` attribute to optimize SEO.

2025-11-06