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.