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 mutual traffic redirection.Display these important partnerships prominently on the website, such as in the footer or sidebar, which can effectively enhance user trust and the authority of the website.AnQiCMS (AnQiCMS) provides a convenient friend link management function and a flexible tag calling method, allowing you to easily achieve this goal.
Overview of the friend link backend management
When usinglinkListBefore the label, we first need to enter the information of the cooperative website into the Anqi CMS backend.The 'Friend Links' management interface is provided in the function management module of AnQi CMS.nofollowAttribute (this is very critical for the weight passing of search engine). The system will properly save this information, so that you can call it at any time on the front end of the website.
UselinkListTag display cooperation website
The template system of AnQi CMS is designed to be very intuitive, allowing you to easily retrieve and display website data with specific tags. To display friendly links, you need to uselinkListLabel.
Basic usage of the tag
linkListThe way to call the tag is very concise. Usually, you would use it like this:
{% linkList friendLinks %}
{# 循环体,用于显示每个友情链接 #}
{% endlinkList %}
Here,friendLinksThis is a variable name you have defined, used to iterate through each friend link data within a loop body. You can name it according to your own habits with more descriptive words.
Supported parameters
linkListThe label supports an optional parameter:
siteIdThis is a parameter for multi-site management. If you have created multiple sites in the Anqi CMS backend 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 of the友情链接 link.
InlinkListInside the loop of the标签 tags.friendLinksEvery one in the变量 variables.item[That is, each friendship link] includes the following commonly used fields, which you can directly call to build links:
item.Title[The display name of the friendship link].item.Link友情链接的目标URL address。【en】item.Remark友情链接的备注信息(if there is any setting on the backend)。【en】item.NofollowA boolean value(1[en] Indicates yes.0indicating whether the link should be added)。【en】rel="nofollow"properties.
Actual code example
Suppose you want to display a row of friendly links at the bottom of the website and ensure adherence to SEO**practices, you can add non-recommended links withnofollowAttributes, you 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 existing, if so, it will display all the links in an unordered list. Each link will be automatically added with properties set in the background.NofollowProperties auto-addedrel="nofollow"And set it to open in a new window.
Where should the friend link be placed?
The display position of the friend link is usually determined by the website's design and operational strategy:
- Website FooterThis is the most common placement, as it does not interfere with the main content and can be easily found by users and search engines. Suitable for displaying a large number of or highly general cooperative links.
- Sidebar (Sidebar)If your website has a fixed sidebar, you can set up a 'Friend Links' module here to provide more direct access.
- Independent PageFor websites that require a detailed introduction of each partner or have a large number of friendship links, create an independent "Friendship Links" page (for example,
/links.htmlIt would be a good choice. You can provide an entry to this page in the main navigation or at the bottom links.
Strategies for the operation of friendship links
Effectively managing友情链接 is an important part of website content operation. Through AnQi CMS, you can flexibly control the display of links and combine SEO strategies:
- [en]Regular updatesUpdate expired links or add new partners in a timely manner to maintain the activity of link resources.
- Quality first[en] Prioritize exchanging friendship links with websites of high quality and strong relevance, avoid link farms to prevent affecting the reputation and SEO performance of your own website.
- Use Appropriately
nofollowFor ad links, links of uncertain quality, or links you do not want to pass weight to, be sure to set them in the backgroundnofollowEnsure that the weight of your website is not dispersed or diluted.
Anqi CMS'slinkListTags, with their simple yet powerful functions, provide great convenience for managing your website's friend links, allowing your website to maintain good external connections while also keeping an excellent SEO status.
Common Questions (FAQ)
- Friend link's
nofollowHow to use the properties?nofollowThis attribute tells the search engine not to follow this link and not to pass the link's weight to the target website. When managing the friendship links in the AnQi CMS background management, you can set whether to enable it separately for each link.nofollowIn the template, calllinkListwhen using theitem.Nofollowvalue (1means enabled,0means disabled), and then act accordingly in<a>tag.rel="nofollow"[As shown in the article example] - Can the友情链接[friendship link] be displayed by group or type?[Currently] the 安企CMS[AnQi CMS]
linkListThe tag will obtain all the added friend links from the background. If you want to divide the friend links into different groups (such as "Strategic Cooperation", "Industry Partners", etc.),linkListThe tag itself does not provide directtypeorgroupFilter the parameters. A common method to implement grouped display is to add a link in the background, marking the group it belongs to in the 'Note' field of the link, and then on the front-end template, you can first get all the links and then judge through them.item.RemarkUse the grouping keywords to manually categorize and display. Alternatively, you can consider custom extensions at the development level of Anqi CMS to add new fields to support grouping. - Can the display order of the link in the friend links be controlled?
linkListThe tag itself does not provideorderUsing the sorting parameter to control the display order.The default display order of friend links usually depends on the time sequence in which they are added or updated in the background, or it is determined by the sorting feature of the backend management interface.friendLinksAfter the data, use the sorting function of the template language (such as some template engines support sorting of arrays)sortorsortedHow to ensure the correct display of dates and times on the front end using timestamp formatting tags? This operation ()} requires support for more complex list processing by your template engine.