In website operation, the cooperative website's friendship link is not only an important part of search engine optimization, but also an effective way to expand brand influence and promote traffic mutual promotion.Display these important cooperative partnerships prominently on the website, such as at the bottom or sidebar, which can effectively enhance user trust and the authority of the website.AnQiCMS (AnQiCMS) provides a convenient friend link management function and flexible tag calling method, allowing you to easily achieve this goal.

Friendship link backend management overview

While usinglinkListBefore the label, we first need to enter the information of the cooperative website into the Anqi CMS backend.The Anqi CMS provides a management interface for 'friend links' in the function management module.You can add, edit, or delete links here, set the name, URL address, and enable or disable each linknofollowProperties (this is very critical for passing the search engine weight). The system will properly save this information so that you can call it at any time on the website front end.

UselinkListTag display of cooperative websites

The AnQi CMS template system is designed very intuitively, allowing you to easily retrieve and display website data using specific tags. To display friend links, you need to uselinkList.

Basic usage of tags

linkListThe way the tag is called is very concise. Usually, you would use it like this:

{% linkList friendLinks %}
    {# 循环体,用于显示每个友情链接 #}
{% endlinkList %}

Here, friendLinksIs a variable name you define, used to iterate over each friendship link data within the loop body. You can name it more descriptively according to your habits.

Supported parameters

linkListThe tag supports an optional parameter:

  • siteId: This is a parameter for multi-site management. If you have created multiple sites in the Anqicms background and want to call the friend links under a specific site, you can setsiteId="您的站点ID"To implement. In most cases, if you have only one site or want to call the link of the current site, you can omit this parameter, and the system will default to getting all friendship links.

Available fields for friend links

InlinkListWithin the loop of tags,friendLinkseach variable initem(That is, each friend link) contains the following commonly used fields, which you can directly call to build links:

  • item.Title: The display name of the友情链接 (friendship link).
  • item.Link: The target URL address of the friend link.
  • item.Remark: Note information of the friend link (if set in the background).
  • item.Nofollow: A boolean value (1indicating yes,0Indicates no), indicating whether the link should be added.rel="nofollow"Property.

Actual code example

Suppose you want to display a row of friendship links at the bottom of the website and ensure that you follow SEO**practices, you can add attributes to non-recommended links.nofollowYou can write the template code like this:

<div class="footer-links">
    <h3>合作伙伴</h3>
    {% linkList friendLinks %}
        {% if friendLinks %} {# 确保有友情链接才显示区域 #}
        <ul class="partner-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>
        {% else %}
        <p>暂无合作网站信息。</p>
        {% endif %}
    {% endlinkList %}
</div>

This code will first check if there is a friendship link present, if there is, it will display all the links in an unordered list. Each link will be automatically added according to the properties set in the backgroundNofollowautomatically addedrel="nofollow"Open in a new window.

Where should the friendship link be placed?

The display location of the friendship link is usually determined by the website's design and operational strategy.

  • Website Footer (Footer)This is the most common placement because it does not interfere with the main content and can be easily found by users and search engines. It is suitable for displaying a large number of or more general cooperative links.
  • Sidebar (Sidebar)If your website has a fixed sidebar, you can set up a "friend link" module here to provide more direct access.
  • Independent page: For websites that need to provide detailed introductions for each partner or have a large number of friendship links, create an independent "friendship links" page (such as/links.htmlIt would be a good choice. You can provide access to this page in the main navigation or footer links.

Considerations for the operation strategy of friendship links.

An effective management of友情链接 is an important part of website content operation. Through 安企CMS, you can flexibly control the display of links and combine SEO strategies:

  1. Regular updatesKeep outdated links or newly added partners updated to maintain the vitality of the link resources.
  2. Quality first: Prioritize exchanging friendship links with high-quality and highly relevant websites, avoid link farms to prevent affecting your own website's reputation and SEO performance.
  3. Reasonable usenofollowFor ad links, links of uncertain quality, or links you do not want to pass weight to, be sure to set them in the backgroundnofollowMake sure your website's weight is not dispersed or diluted.

Of Security CMSlinkListTags with their simple yet powerful functions provide great convenience for managing your website's友情链接 links, allowing your website to maintain good external connections while also keeping an excellent SEO status.


Frequently Asked Questions (FAQ)

  1. The link of friendshipnofollowHow to use the attribute? nofollowThe attribute is used to tell the search engine not to follow this link and not to pass the link weight to the target website. When managing friend links in the Anqi CMS background management, you can set whether to enable each link separately.nofollow. Call in the templatelinkListwhen the tag is encountered, just judgeitem.NofollowThe value(1means enabled,0means disabled), then respond accordingly in<a>the tag withrel="nofollow"As is, as shown in the article example.
  2. Can the friend link be displayed by grouping or type?The current Anqi CMSlinkListThe tag will retrieve all the friendship links added to the background. If you want to divide the friendship links into different groups (such as "strategic cooperation", "industry partners", etc.),linkListThe label itself does not provide directtypeorgroupFilter parameters. A common method to implement grouping display is to add a link in the background, marking its group in the "remark" field of the link, and then in the front-end template, you can first get all the links, and then judge through them.item.RemarkThe grouping keywords can be manually categorized and displayed. Alternatively, you can consider custom extensions on the development level of AnQi CMS to add new fields to support grouping.
  3. Can the display order of the friendship link be controlled? linkListThe tag itself does not provideorder(Sorting) The parameter is used to control the display order. The default display order of friend links usually depends on the order in which they are added or updated in the background, or by the sorting function of the background management interface.If you need to control the display order of the front-end precisely, you can adjust the sorting through the back-end management interface (if the system supports it), or after obtainingfriendLinksAfter the data, use the sorting function of the template language (such as some template engines support sorting arrayssortorsortedOperation), but this requires your template engine to support more complex list processing.