As a senior security CMS website operator, I fully understand the importance of efficient content management and front-end display to the success of the website.Friend links are an important part of website external cooperation and SEO optimization, and their convenient acquisition and display methods are an indispensable part of daily operation.Now, I will explain in detail how to obtain and display the list of friend links configured in the AnQiCMS backend.

Anqi CMS: Efficient management and display of backend friend links list

Friend links, as an important part of the construction of website external links, can not only improve the effect of search engine optimization (SEO), but also provide users with more navigation to 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.

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

Displaying the friendship links configured on the background to the front page of the website is a key step to attract users and pass on SEO value. AnQiCMS provides speciallinkListTemplate tags make this process simple and clear. You just need to use this tag in the template file where you need to display the friend links to easily call the background data. The following is the use oflinkListBasic methods and example code for retrieving and displaying the list of friendship links.

Firstly, you need to use it in the template file.{% linkList 变量名称 %}The format to obtain friendship link data. Usually, we would name the variablefriendLinksThis indicates a list of friendship links. The tag will retrieve all the friendship links configured in the background and assign them as an array object to the variable you define.

Then, you can make use offorLoop throughfriendLinksthe array to sequentially obtain the detailed information of each friendship link. Each link object includesTitle(Link name),Link(link address),Remark(link notes) andNofollow(Whether to add the Nofollow attribute, a value of 1 indicates yes, 0 indicates no) and these fields can be directly passed through the templateitem.字段名method.

This is a complete code example of displaying a 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 code above, we first use{% linkList friendLinks %}Get the friend link list by tag. Then,{% if friendLinks %}Check if there is friend link data to avoid displaying an empty area when there are no links.forIn the loop, we use{{item.Link}}to output the link address,{{item.Title}}to output the link name, and through{% if item.Nofollow == 1 %} rel="nofollow"{% endif %}Intelligently add the corresponding tag to the links that are checked with the Nofollow attribute, which is crucial for SEO health. At the same time, we will alsoitem.RemarkastitleAttribute added to provide a better user experience.

In the operation of friendship links, we recommend that you pay attention to the quality of the links rather than the quantity.Choose partners highly relevant and with high weight to your website content, which can better promote website SEO.Regularly check the validity of友情链接 links, ensure that the links are not expired, and update them in a timely manner.For external links, use reasonablyrel='nofollow'The attribute is a practice for maintaining the SEO health of a website, it tells search engines not to follow these links to avoid passing unnecessary weight.

Through AnQiCMS's "Friend Links" management function andlinkListTemplate tag, you can efficiently display the friend links configured on the background in 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 operation simpler, allowing your website to stand out in the digital world.


Frequently Asked 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 Management" under the "Friend Links" module, and confirm whether you have added the friend link. If there is link data in the background, then check whether your template file has used it correctly.linkListthe tags, andforThe variable name in the loop should be consistent with the variable name defined in the label. Additionally, if the front-end does not take effect immediately after modifying the template file, please try to clear the 'Update Cache' in the AnQiCMS background or clear your browser cache.

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

When adding or editing a link in the "Function Management" > "Friend Links" section of the AnQiCMS backend, you will see an option (usually a checkbox) to set whether to enable the Nofollow attribute. Check this option, and when you use the template on the front-endlinkListThe system will automatically render according to the settings on the back end when these links are called<a>Add tags whenrel="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 links from the "friend links" module on the backend, and does not directly support filtering by "group".If you need to implement the requirement of grouping friendship links and displaying them on different pages, you can consider using the "Note" field when adding links in the background to add specific identifiers for different groups of links (for example: "Partners", "Industry Associations").Then you can in your template file,forAdd within the loopifConditional judgmentitem.Remarkfield, to selectively display or group display friendship links based on the remarks. For example,{% if item.Remark == "合作伙伴" %}.