As an experienced website operator who deeply understands the operation of AnQiCMS, I know the value of friendship links to a website.They are not just simple external links, but also an important way to improve website authority, attract high-quality traffic, and enhance user trust.By carefully managing and arranging the links, we can effectively optimize the search engine performance of the website and provide visitors with more valuable extension information.

This article will detail how to set up友情链接 in AnQiCMS and display it correctly in your website template.

Set up友情链接 in the AnQiCMS backend.

Managing friend links in AnQiCMS is an intuitive and efficient process.First, you need to log in to your AnQiCMS admin interface.Once logged into the backend, you will see the function menu on the left, which includes the entry points for various functions of the website.

Please find and click on the item 'Function Management'. In the sub-menu of 'Function Management', you will find an option named 'Friend Link'.Click it to enter the management page of the friendship link.

On this page, you can perform all operations related to the link exchange. When you need to add a new link exchange, the system will provide the corresponding form for you to fill in the various information of the link, usually including:

  • Link NameThis is the name displayed for the friendship link on your website, which is usually the name or brand word of the other website.
  • Link AddressThis is the complete URL of the other website, make sure it is correct so that users can access it smoothly.
  • Link note: You can add some internal notes to the link for easy management and identification, and these notes are usually not displayed on the front end.
  • Is NofollowThis is an important SEO option. If this option is checked, the system will add it to the HTML code of the link exchange.rel="nofollow"This tells the search engine that the link should not pass the weight of your website, usually used to avoid passing weight to external websites that are not fully trusted, or to comply with search engine guidelines.

In addition to adding links, you can also edit the information of existing links on this page, or delete those that are no longer needed or have expired.AnQiCMS provides a clear interface to ensure that you can easily maintain these external resources.According to the update log, AnQiCMS v2.1.1 also added API interfaces to support the addition and deletion of friend links, which provides more flexibility for users with customized needs.

Correctly call to display the friend link in the website template

After setting up the back-end of the friend links, the next step is to display them on your website's front page.AnQiCMS through its powerful template tag system makes it very simple to call data in the template.We will uselinkListTag to get and display the friend link.

First, open the file in your website template that needs to display the friend link, which is usually the footer file, or a specific area on the homepage, or even a dedicated friend link page.

You can use{% linkList 变量名称 %}This structure is used to call the friend link data. For example, you can name the variablefriendLinks.

{% linkList friendLinks %}
    {% if friendLinks %}
    <div class="footer-links-section">
        <h3>友情链接</h3>
        <ul class="friendship-links-list">
            {% for item in friendLinks %}
            <li>
                <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 snippet:

  • {% linkList friendLinks %}The statement tells AnQiCMS to retrieve all friend links and store them in a namedfriendLinks.
  • {% if friendLinks %}Is a conditional judgment to ensure that the entire block is rendered only when there is friend link data, to avoid the page appearing with empty titles or empty lists.
  • {% for item in friendLinks %}Loop throughfriendLinksEach item in the friend link array. Inside the loop,itemRepresents the current friend link object.
  • {{item.Link}}Used to output the URL address of the friend link.
  • {{item.Title}}Used to output the display name of the friend link.
  • {% if item.Nofollow == 1 %} rel="nofollow"{% endif %}Check if the link is marked as in the backgroundnofollow. If it is, then<a>the tag withrel="nofollow"Property.
  • target="_blank"Properties are usually used to make links open in a new window or tab to preserve the current browsing session of the user on your website.
  • title="{{item.Remark}}"The notes set in the background can be used as links.titleAttribute, when the mouse hovers over it, a note will be displayed to help improve the user experience.

By using such a simple template code, you can dynamically display the friendship links configured on the back-end of your website on the front-end.Please note that it is recommended to add appropriate CSS styles to the link of friendship in order to keep the website neat and provide a good user experience, making it consistent with the overall design style of the website.At the same time, regularly checking the validity of friendship links, deleting invalid links, is an important part of maintaining website health.

Frequently asked questions about friendship links.

What is the role of the "Nofollow" attribute in the friend link? Answer: When setting up friend links in AnQiCMS, if the "Nofollow" attribute is checked, the system will add it to the HTML code of the link.rel="nofollow"This means that search engines usually do not pass this link as a weight when crawling websites, which helps inform search engines that this link is not an endorsement of your website's votes.This is usually used to avoid passing weight to untrusted external websites, or to comply with specific search engine guidelines.

Ask: How to manage friendship links in AnQiCMS backend? Answer: You can log in to the AnQiCMS backend management interface, then navigate to the "Function Management" section, where you can find and click the "Friend Links" option.After entering, you can conveniently add new friendship links, edit the names, URLs, notes of existing links, and whether to set the Nofollow attribute, as well as delete links that are no longer needed.

Ask: Where should the friendship link be placed on the website? Answer: Friendship links are usually placed at the bottom (footer) of a website or on a dedicated "Friendship Links" page.This makes it convenient for users to find information without disrupting the reading experience of the main content of the website.According to the design style of the website and your SEO strategy, it is also appropriate to display it in the sidebar or other less noticeable but easily accessible locations in moderation.