As an experienced CMS website operation personnel for security, I fully understand the importance of efficient content management and frontend display for the success of the website.友情链接作为网站对外合作和SEO优化的一个重要组成部分,其便捷的获取和展示方式是日常运营中不可或缺的一环。Now, I will elaborate in detail on how to obtain and display the list of friend links configured in the AnQiCMS backend.

Anqi CMS: Efficient management and display of the background friend links list

Friendship link, as an important part of the construction of external links on a website, not only can improve the search engine optimization (SEO) effect, but also provide users with more navigation of relevant resources.In AnQiCMS, we fully understand its value and therefore provide a set of intuitive and powerful features to help website operators easily manage and display these valuable links.

In the AnQiCMS backend management interface, you can manage the friend links by navigating to the "Friend Links" module under "Function Management."Here you can conveniently add new friend links, including setting the link name, URL address, remarks information, and whether to add the Nofollow attribute.This centralized management approach ensures that all友情链接 can be unifiedly maintained in one place, greatly enhancing management efficiency, and also supports batch operations through API interfaces, meeting the needs of advanced users and multi-site management.

Display the friendship links configured on the backend to the front page of the website, which is a crucial step to attract users and convey SEO value. AnQiCMS provides a speciallinkListTemplate tags make this process simple and clear. You just need to use this tag in the template file where you want to display the friend link, and you can easily call the background data.linkListThe basic methods and example code for obtaining and displaying the friend link list tag.

Firstly, you need to use the template file in{% linkList 变量名称 %}format to obtain friend link data. Usually, we will name the variable.friendLinksThis indicates that this is a list of友情链接 links. The label will fetch all the friendship links configured on the back-end and assign them as an array object to the variable you define.

Then, you can useforto iteratefriendLinksan array to get the details of each friendship link one by one. Each link object includesTitle(Link Name),Link[Link address],Remark(Link Note)andNofollow(Whether to add the Nofollow attribute, a value of 1 indicates yes, 0 indicates no) fields, these fields can be directly entered in the template throughitem.字段名method.

The following is a complete code example of displaying the friend link list in the AnQiCMS template:

{% linkList friendLinks %}
{% if friendLinks %}
<div class="friendship-links">
    <h3>友情链接</h3>
    <ul class="links-list">
    {% for item in friendLinks %}
        <li class="link-item">
            <a href="{{item.Link}}" {% if item.Nofollow == 1 %} rel="nofollow"{% endif %} target="_blank" title="{{item.Remark}}">
                {{item.Title}}
            </a>
        </li>
    {% endfor %}
    </ul>
</div>
{% endif %}
{% endlinkList %}

In the above code, we first use{% linkList friendLinks %}Get the friend link list by tag. Then,{% if friendLinks %}Check if there is friendship link data, to avoid displaying an empty area when there are no links.forIn the loop, we use{{item.Link}}output the link address,{{item.Title}}Output the link name, and through{% if item.Nofollow == 1 %} rel="nofollow"{% endif %}Automatically add appropriate tags to links that have the Nofollow attribute checked, which is crucial for SEO health. At the same time, we will alsoitem.RemarkastitleAttribute addition to provide a better user experience.

In the operation of友情链接, we suggest that you pay attention to the quality of the links rather than the quantity.Choose partners that are highly relevant and have high weight to your website content, which can better promote your website SEO.Regularly check the validity of友情链接 links, ensure that the links have not expired, and update them in a timely manner.rel='nofollow'Properties are practices that maintain the SEO health of a website, they inform search engines not to follow these links, thus avoiding the passing of unnecessary weight.

Through the "Friend Links" management function of AnQiCMS,linkListTemplate tags, you can efficiently display the友情链接(friend links) configured on the backend on the front end of the website.This seamless integration not only simplifies the content management process, but also brings better user experience and search engine visibility to your website.We are committed to making content operations simpler, allowing your website to stand out in the digital world.


Common Questions (FAQ)

1. What should I do if my friend link does not display on the front-end page?

First, please log in to the AnQiCMS backend, go to the "Function ManagementlinkListlabels, andforThe variable name in the loop is consistent with the variable name defined in the label.In addition, if the front-end does not take effect immediately after modifying the template file, please try to clear the 'Update Cache' in AnQiCMS backend, or clear your browser cache.

2. How to add a friend linkrel="nofollow"properties?

In AnQiCMS backend “Function Management” -> “Friend Links” section, when you add or edit a link, you will see an option (usually a checkbox) to set whether to enable the Nofollow attribute. Check this option and when you use it in the front-end template,linkListWhen calling these links, the system will automatically render according to the settings in the background<a>while adding tagsrel="nofollow"Property. You do not need to manually modify the template code to add this property, just manage it in the background.

3. Can I create friendship links in different groups and display them on different pages?

Based onlinkListThe current design of the label, it will retrieve all the friend links from the "Friend LinksIf you need to implement the requirement of grouping friend links and displaying them on different pages, you can consider adding a specific identifier (such as "partners" or "industry associations") for links of different groups when adding links in the background.foradding inside the loopifConditional judgmentitem.RemarkFields, selectively display or group the friendship links according to the content of the notes. For example,{% if item.Remark == "合作伙伴" %}.