How to add and display friendship links on the Anqi CMS website?

Calendar 👁️ 55

In website operation, friend links play an indispensable role.They not only help to improve the search engine ranking (SEO) of a website, but also bring potential traffic and improve the user experience, allowing visitors to get more information through related websites.AnQiCMS (AnQiCMS) understands this and therefore provides an intuitive and convenient link management function, allowing you to easily add, manage, and display these important external connections on your website.

This article will provide a detailed introduction on how to add友情链接 (friend links) in the Anqi CMS backend, as well as how to flexibly display them in the website's frontend template, helping your website better integrate into the internet ecosystem and maximize its value.

One, add friends link in Anqi CMS background

First, let's start from the website background and include the new friends link in your management scope.

  1. Enter the friends link management interfaceLog in to your AnQi CMS backend. Find and click on the "Function Management" option in the left-hand navigation menu.In the expanded submenu, you will see the option "Friend Links", click it to enter the Friend Links list page.

  2. Add a new friend linkAt the top or in a prominent position of the friendship link list page, there is usually a 'Add Friendship Link' button. Clicking this button will pop up a form for you to fill in the detailed information of the new link:

    • Link Name (Title)This is the text displayed to visitors on your website for the friend link, which is usually the name or brand word of the other website.
    • Link AddressEnter the complete URL address of the other website, make sure to include it.http://orhttps://Prefix, make sure the address is accurate and avoid link failure.
    • Remark (Remark)This is an optional field, you can add internal notes to the link, such as the contact person of the counter-website, the date of cooperation, etc. These pieces of information will not be displayed on the website front end and are only for background management use.
    • Nofollow attribute (Nofollow)This is a very important SEO option. Checking this means you are telling the search engine 'Do not follow this link' or 'Do not pass my website weight to this link'.Generally, it is recommended to check for ad links, links that are not completely trusted, or links in user-generated contentNofollowTo better control the SEO weight flow of your website. For high-quality, mutually beneficial partner links, you can leave them unchecked to allow the weight to pass normally.

    After filling out, click the "OK" or "Save" button, your new friendship link will be successfully added to the background management list.

  3. Manage existing friendship linksOn the friends link list page, you can perform various operations on the links you have added.For example, you can edit the link name, address, or Nofollow attribute;You can delete links that are no longer cooperative or invalid; typically, the system will also provide a sorting function, allowing you to adjust the display order of friend links according to importance or cooperative relationships.Regularly checking and maintaining the quality of friendship links is an important aspect of maintaining a good SEO performance for a website.

Second, display the friend link in the Anqi CMS front-end template

After adding the friendship link in the background, you will need to display them on the front page of your website next.AnQi CMS provides powerful template tag features, making this process very flexible and efficient.

  1. Choose a suitable template fileFriend links are usually placed at the footer, sidebar, or a special "friend links" page of a website.You need to find the corresponding template file to edit according to the design and requirements of the website.For example, if you want to display it in the footer, you can editpartial/footer.htmlorbash.html(If the footer is a common part and it passes throughincludeintroduction).

  2. UselinkListTag to get friend link dataAnqi CMS built-inlinkListTags, specifically used to retrieve all added friendship link data. Its basic usage is very simple:

    {% linkList friendLinks %}
        {# 在这里处理友情链接数据 #}
    {% endlinkList %}
    

    In this example,friendLinksThis is a variable name you customize for the friend link list data you obtain, you can name it according to your own habits.

  3. Loop through and display the friend links friendLinksA variable is an array object containing all the link information of friendship. You need to traverse these links through a loop and display their names, addresses, and other information.forLoop to iterate through these links one by one and display their names, addresses, and other information.

    Each friendship link item (usually named in the loop as)item) includes the following available fields:

    • item.Title: Link name.
    • item.Link: Link address.
    • item.Remark: Link note (for backend use only, usually not displayed on the front end).
    • item.Nofollow: The value of the Nofollow attribute is1Indicates that Nofollow is selected, for0Unselected.

    Combine these fields to build the HTML structure of the friendship link. Below is a commonly used example code that can be directly copied into your template file:

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

    This code first judgesfriendLinkswhether the list is empty, to avoid displaying an empty title and list when there are no friendship links. Then, it loops through each link, creating one for each link.fora loop to traverse each link, creating one for each link.<a>Label. Note{% if item.Nofollow == 1 %} rel="nofollow"{% endif %}This code, it will dynamically add attributes to the link based on the backend settings,rel="nofollow"at the same time,target="_blank"The attribute ensures that the link opens in a new window or tab, enhancing the user's browsing experience.title="{{item.Title}}"Then the link name can be displayed when hovering over it, increasing readability.

  4. Save and update cacheAfter modifying the template file, please save your changes. To ensure that the website's front-end displays the latest content in a timely manner, you may need to click on the "Update Cache" feature in the Anqi CMS backend and clear the system cache.After that, refresh your website page, and you will see the new added and displayed link.

By following these steps, you can efficiently manage and display friend links in Anqi CMS, which not only optimizes the SEO performance of the website but also provides visitors with more valuable external resources.The design concept of AnQi CMS is to make content management simple and powerful, and the function of friend links is a reflection of this concept.

Frequently Asked Questions (FAQ)

1. Does AnQi CMS support image links for friendship links? How should you operate if you need an image link?The 'Friend Link' function built into AnQi CMS is mainly designed for text links, and currently its template tags (linkListThe field does not contain image addresses. If your website needs to display friend links with thumbnails or logos, you can consider the following two methods:

  • Create a custom content model:Utilize the flexible content model feature of Anqi CMS to create a new model specifically for managing image links.In this model, you can customize the 'Link Name', 'Link Address', and 'Link Image (Logo/Thumb)' fields, etc.Then, through custom template tags such asarchiveListCoordinate with specificmoduleId) to call and display these image links.
  • Use 'single page' combined with manual HTML writing:If the number of image links is not many, you can create a special "Friend Links" single page in the "Page Management".In the content editor on this page, you can directly manually insert HTML link code with images.

2. What is the specific role of the Nofollow attribute in friend links? When should it be used? rel="nofollow"It is an HTML attribute used to tell search engine crawlers not to follow the link, and not to pass any of your website's 'link equity' (Link Equity) to the linked website. Its main purpose is to:

  • Control SEO weight loss:When you link to a low-quality, untrusted, or website that is not completely relevant to your content, using Nofollow can prevent your website's authority from being diluted or passed on to inappropriate websites.
  • Follow the search engine guidelines:For links that are paid, advertisement, or posted in comment sections, forums, etc., search engines usually require the use of Nofollow to prevent manipulating search rankings.
  • When to use:It is recommended to use the Nofollow attribute for advertising links, sponsored content, user-posted uncontrolled links, and external links whose content quality or relevance to your website theme you are unsure of. For links that have been strictly selected, have high-quality content, and are mutually beneficial to your website, providing value to users, it is usually unnecessary to add Nofollow

Related articles

How to display and manage the website message form of AnQi CMS and customize fields?

The website message form is an important link between users and the website, it not only helps us collect valuable opinions and suggestions, but also lays the foundation for various interactive functions such as user consultation and service reservation.AnQi CMS is well-versed in this, providing website operators with a straightforward, efficient, and highly customizable feedback form solution, making it exceptionally simple to manage and customize form fields.### Easily build the frontend presentation of the message form In Anqi CMS, to display the message form on the website page, you do not need to write complex backend logic, just insert the specific tags in the template file

2025-11-08

How to retrieve and display the document list under a specified Tag in AnQi CMS?

AnQiCMS (AnQiCMS) offers great convenience to website operators with its flexible content management and powerful template engine.In daily content operation, we often need to aggregate and display lists of related documents based on specific tags (Tag), such as 'Hot Topics', 'Technical Tips', or 'Product Reviews' and so on.This not only helps users quickly find the content they are interested in, but also effectively improves the internal link structure of the website, which is very beneficial for SEO.This article will delve into how to retrieve and display a list of documents under a specified tag in AnQiCMS

2025-11-08

How to set and display a custom template on a single page of AnQi CMS?

AnQi CMS, with its powerful flexibility and ease of use, has become a helpful assistant for many content operators.Especially in terms of content display, it provides us with rich customization space.For those web pages that require unique layouts or specific functions, such as "About Us", "Contact Us", or a special event landing page, we often hope that they can have a completely different visual style from ordinary articles or list pages.Aqii CMS provides a very convenient way for us to set exclusive custom templates for these single-page websites

2025-11-08

How to display the child category list of a specified category in Anqi CMS

The way website content is organized is crucial for user experience and information retrieval efficiency.A clear classification structure not only helps visitors quickly find the information they need, but also effectively enhances the professionalism and user retention rate of the website.In AnQiCMS (AnQiCMS), the flexible template tag system makes it very convenient to display the subcategory list of a specified category.### Core Tool: The Use of `categoryList` Tag To display the child category list of a specified category in Anqi CMS, we mainly use the `categoryList` tag

2025-11-08

How does the comment function of AnQi CMS display comment lists and reply levels?

AnQiCMS (AnQiCMS) as an efficient and flexible content management system, provides rich content display capabilities while also offering a comprehensive comment function for user interaction.Understand how to effectively display a comment list, especially in handling multi-level replies, which is crucial for enhancing the user engagement and content depth of a website. ### AnQiCMS Comment Function Implementation Basics Commenting functionality is an important part of website content interaction in AnQiCMS.The system is not only built-in with support for comments on articles, products, and other content

2025-11-08

How can conditional judgments (if/else) be used in the AnQi CMS template to control content display?

AnQiCMS template development skills: flexibly use conditional judgment (if/else) to control content display In website content operation, we often need to display or hide specific content blocks based on different conditions, or to differentiate the display based on different data states. AnQiCMS (AnQiCMS) powerful template engine provides us with flexible conditional judgment capabilities, through the clever use of `if/else` statements, you can easily achieve the fine-grained control of content, making your website more dynamic and user-friendly.

2025-11-08

How to perform a loop (for) in Anqi CMS template to display list data?

When building a website page, we often need to display various list data, such as the latest articles, product categories, navigation menus, or comment details.The template system of AnQiCMS provides us with a powerful and flexible loop traversal function, making the display of dynamic lists very simple.The template syntax of AnQi CMS borrows from the Django template engine, so users familiar with this syntax will feel very close.It uses the `for` loop label to iterate over the data collection and display each item one by one.###

2025-11-08

How to format a timestamp into a readable date and time format and display it in AnQi CMS?

In website content operations, the presentation of time is often ignored, but it is an important detail for improving user experience and content professionalism.The original timestamp number lacks meaning for ordinary users. Formatting it into a clear and easy-to-read date and time format makes the content more appealing.AnQi CMS knows this, providing a simple and powerful way to handle such needs.### Understanding the timestamp in AnQi CMS In AnQi CMS, whether it is the publication time (`CreatedTime`) or the update time (`UpdatedTime`)

2025-11-08