As a senior website operation expert, I fully understand the importance of friendship links for websites.They are not only effective means to improve the performance of search engine optimization (SEO), but also ways 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, 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 getting started with the frontend display, we first need to understand how the友情链接 (friendship link) is managed in the AnQiCMS backend.The design of AnQiCMS fully considers the needs of operators and provides a centralized and convenient backend management interface.Enter the backend management interface of AnQiCMS, and you will find a "Friend Links" option under the "Function Management" module.Here, you can easily add, edit, or delete友情链接 links.
Each friendship link can be configured with the following key information:
- Link Name (Title)This is the name displayed for the friendship link on the website front end, it should be clear and understandable.
- Link address (Link): The URL of the target website, ensure its accuracy and correctness.
- Link Remark (Remark))An internal note for easy management and memory of the link source or collaboration 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 generated links on the frontend.
rel="nofollow"Property.This 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 reasonably can effectively 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, demonstrating its deep understanding and support for modern SEO practices.The operator can flexibly decide whether to pass on the weight based on the quality and relevance of the partner website, thus better controlling the website's SEO strategy.
Correctly call the friend links list on the website frontend.
Once the friendship link is configured in the background, the next step is to display them on your website. AnQiCMS provides a special template tag —linkListThe process becomes exceptionally simple and efficient.linkListTags can retrieve all configured friend links from the database and allow you to loop them in any template file on the website.
linkListBasic usage of the tag
linkListThe label calling is very intuitive. You need to specify a variable name to store the collection of retrieved friend links, for example, we can name itfriendLinks. The basic call structure is as follows:
{% linkList friendLinks %}
{# 在这里放置循环代码来展示每个友情链接 #}
{% endlinkList %}
In{% linkList friendLinks %}and{% endlinkList %}between, you can useforin a loop to iterate overfriendLinkseach friendship link item in the variable. Each loop item (such asitem) will contain the detailed information of the link, such as:
item.Title: The display name of the friendship link.item.Link: The target URL of the friendship link.item.RemarkEnglish: Link remark (if to be displayed on the front end).item.NofollowEnglish: A boolean value (usually 1 for true, 0 for false), used to determine whether to addrel="nofollow"properties.
A complete code example
The following is a typical code snippet demonstrating how to call and display the link list in your AnQiCMS template. This code will intelligently add or not add the Nofollow attribute based on the settings 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 %}:is a good practice, it ensures that the entire friend link area will be rendered only when there is actual friend link data, thus avoiding the display of an empty title or container when there are no links.href="{{ item.Link }}":Dynamic link generation target address.{% if item.Nofollow == 1 %}rel="nofollow"{% endif %}:Based on the backend configuration.NofollowAttribute value, conditionally addedrel="nofollow".target="_blank"English: Usually used for friendship links, ensuring that it opens in a new tab when clicked without affecting the user's current browsing.title="{{ item.Remark if item.Remark else item.Title }}"If the background has set notes, then use the notes 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, so it will be displayed at the bottom of all pages. If you need to put it in aspecific pageDisplay for example, an independent page or a single page such as "friend links", simply insert the above code snippet into the corresponding template file of this page.
In addition,linkListTags also support an optionalsiteIdParameters. If you are using the multi-site management feature of AnQiCMS and want to call another site's friend link on the current site, you can use it in this way:
{% linkList friendLinks with siteId="2" %}
{# ... 循环展示代码 ... #}
{% endlinkList %}
Among themsiteId="2"Represents the friendship link of 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:
- Regular reviewCheck if the friendship links are still active and the content is healthy, avoid linking to inactive or harmful websites.
- Relevance:Select friend links highly relevant to your website content, which not only brings more targeted traffic but also benefits SEO.
- Moderate in number:Friendship links are not the more, the better; quality is far more important than quantity.
Common Questions (FAQ)
Q1: Why can't I see the friendship link displayed on the website even though I added it?A1: This usually has several reasons.Firstly, please make sure that you have successfully added the link under the "Friend Links" section of the "Function Management" in AnQiCMS backend, and they are enabled.footer.htmlOr a dedicated friend link page template) was used correctlylinkListTemplate tags, and there are no spelling errors. If your website has enabled caching, try clearing the cache of AnQiCMS background to ensure that the latest content can be loaded.
Q2:rel="nofollow"What is the function of the 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 flow of the website, avoiding search engine penalties that may occur due to linking to irrelevant, low-quality, or paid links (ads).nofollow,like advertisements, sponsored content, or friend links whose content quality and relevance you cannot fully guarantee. For high-quality, highly relevant, and recognized cooperative websites, you can choose not to usenofollow,to promote weight transmission and win-win cooperation. AnQiCMS backend provides a checkbox, allowing you to control it flexibly.
Q3: I want the friend link list to look more beautiful, does AnQiCMS support custom styles?English: Certainly supported.AnQiCMS as a content management system is 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.linkListLabel-generated HTML structure adds custom CSS classes inside and outside (for example, as shown in the example)friendship-links),Then write the corresponding style rules in your website CSS file to fully customize the display effect of the link list, so that it is consistent with the overall design style of your website.