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