Manage and display friendship links in Anqi CMS, which not only helps to enrich the diversity of external connections of the website, but also is a crucial link in precise operations during SEO optimization. Especially how to flexibly control according to needs.nofollowThe attribute is crucial for maintaining the health of website links and passing on weight. AnQi CMS provides an intuitive and powerful function that allows us to easily achieve these goals.
Configure friend links in the Anqi CMS backend
Firstly, all the friend links displayed on the front end cannot be separated from the detailed configuration on the back end.In the AnQi CMS management interface, you can find the "Function Management" under the "Friend Links" module.This is the place where you manage all external collaboration links.
When you add or edit a friend link, you will see the following key fields:
- Link NameThis is the name displayed on the front end for the友情链接, such as “安企CMS official website”.
- Link AddressThis is the complete URL pointing to the target website, such as
https://en.anqicms.com. - Link noteAn internal note that helps you understand the use of the link or the partner, this note is usually not displayed on the front page.
- Link nofollowThis option is particularly important. It is a checkbox that allows us to control whether to inform the search engine that this link should not pass the weight of our site, and also not recommend that the search engine spider track it.
Check the "nofollow" link option, which means that when rendering on the front end,<a>the tag will automatically add.rel="nofollow"Property. This has a very practical significance for controlling the SEO link weight distribution of a website, avoiding unnecessary weight loss, or indicating that a link is not a strong recommendation from this site.
Display friend links flexibly on the website front end
After managing the background data well, the next step is to display these friend links on the website page. The template system provided by Anqi CMS offerslinkListTags can help us easily retrieve the friend link data configured on the back-end.
Generally, we would place the友情链接 friendship link at the footer or on a dedicated friendship link page. Below is a basic template code example showing how to retrieve and loop through friendship links:
{% linkList friendLinks %}
{% if friendLinks %}
<div>
<h3>友情链接:</h3>
<ul>
{% for item in friendLinks %}
<li><a href="{{item.Link}}" target="_blank">{{item.Title}}</a></li>
{% endfor %}
</ul>
</div>
{% endif %}
{% endlinkList %}
In this code block:
{% linkList friendLinks %}All friendship link data will be loaded into a namedfriendLinks.{% if friendLinks %}Check if there is friendship link data to avoid displaying an empty title when there are no links.{% for item in friendLinks %}Iterate over each friendship link,itemThe variable represents the current loop link data.{{item.Link}}and{{item.Title}}Get the address and name of the link separately.target="_blank"It is a commonly used HTML attribute that opens links in a new window or tab, enhancing user experience.
Add cleverly according to needs.nofollowproperty
Now, let's solve the core issue: how to dynamically add friend links on the front end based on the backend settingsnofollowProperty. As mentioned earlier, the 'nofollow' link checkbox in the background affects each link'sNofollowProperty value. In the template, we can judge by theitem.NofollowThe value determines whether to addrel="nofollow".
item.NofollowThe rule for the value is: if the background is checkednofollowIts value is usually1if not checked, it will be other values (such as0or empty). We can take advantage of this feature to add a simple conditional judgment inside the<a>tag. Below is the modified template code that includes
a conditional judgment of thenofollowattribute:
{% linkList friendLinks %}
{% if friendLinks %}
<div>
<h3>友情链接:</h3>
<ul>
{% for item in friendLinks %}
<li>
<a href="{{item.Link}}"
{% if item.Nofollow == 1 %} rel="nofollow"{% endif %}
target="_blank">
{{item.Title}}
</a>
</li>
{% endfor %}
</ul>
</div>
{% endif %}
{% endlinkList %}
through this line{% if item.Nofollow == 1 %} rel="nofollow"{% endif %}We have implemented dynamic controlnofollowproperty. If the background has checked a link'snofollowoption, then when the front-end is rendered, the<a>tag of the link will automatically includerel="nofollow"If not, it will not be included. This flexible design allows website operators to accurately manage the attributes of each friend link according to specific cooperative agreements or SEO strategies.
Through these features provided by Anqi CMS, managing the website's link exchange becomes both efficient and in line with SEO practices.Whether it is to maintain the external image of the site or to carry out fine-grained link weight control, Anqi CMS provides solid technical support.
Frequently Asked Questions (FAQ)
Q1: Why is the friend link I set in the background not displayed on the website front end?A1: First, please check if you have used the front-end template file correctly.linkListThe label and whether the loop within the label is correctly traversedfriendLinksVariable. Secondly, confirm that the friendship link you added to the backend has been enabled, and that there are no other conditions (such as custom template logic) that prevent it from being displayed.You can use the browser developer tools to check the HTML source code of the page to see if there is any link data output, thereby determining whether it is a backend configuration issue or a frontend template rendering issue.
Q2:rel="nofollow"What specific role does the attribute play? When should I use it?A2:rel="nofollow"The attribute tells the search engine not to follow this link and not to pass any "link weight" or "ranking signals" from your website to the target website. This is usually used in the following situations:
- Paid link or advertisementTo comply with the guidelines of search engines, indicate that these links are sponsored and should not pass on weight.
- User Generated Content (UGC)For example, links in comments or forum posts, as you cannot fully trust the quality of the content published by users.
- Untrusted or low-quality external linksWhen you need to link to certain content but doubt its quality or authority and do not want to pass on its weight.
- Friendship Link: Selectively add friendship links based on the quality of the partner's website and your SEO strategy
nofollowto better control the flow of link weight to your website.
Q3: Can I add internal links in the friend links section? Does this help with SEO?A3: In terms of technology, you can add internal links in the友情链接 section.However, doing so is usually not**practical, and it has limited help for SEO, and may even cause confusion.The main purpose of友情链接 is to link to external websites, while internal links are mainly achieved through website navigation menus, article inlinks, sidebar recommendations, and other methods.Place internal links in the "friend links" area may reduce their naturalness and the efficiency of user discovery.It is recommended that you adopt the conventional internal link strategy to optimize the site structure, rather than through the friendship link module.