How to display the friend link list in AnQiCMS?

Calendar 👁️ 58

In AnQiCMS, managing and displaying friend links is very important for improving the website's search engine optimization (SEO) performance, increasing the number of external links, and promoting traffic interflow between websites.AnQiCMS as a fully functional content management system, provides intuitive backend operations and flexible template tags, allowing you to easily display a list of friend links on your website.

1. Manage friend links in AnQiCMS backend

First, you need to add and manage friendship links in the AnQiCMS backend. The system provides a dedicated module to handle this requirement, and the process is very simple:

  1. Log in to the backend:Log in to the AnQiCMS backend management system using your administrator account.
  2. Navigate to the friend link management:In the left menu bar, find and click the "Function Management
  3. Add or edit friendship link:
    • On the friendship link management page, you can view all the friendship links that have been added.
    • Click the "Add友情链接" button, you will see a form that requires you to fill in the relevant information for the friendship link, such as:
      • Link Name (Title):This is the text displayed by the friendship link, which is usually the name of the other website.
      • Link Address (Link):The complete URL address of the other website, make sure to end withhttp://orhttps://At the beginning.
      • Remark (Remark):Can fill in some internal remarks information, which will not be displayed on the front end.
      • Nofollow:This is an important SEO attribute. If you do not want to pass the weight of your website to the other website, it is recommended to check this option. It will be added in the link.rel="nofollow"Property.
    • Fill in the details and click Save. You can also edit or delete existing friendship links at any time.

Part two: Display the friendship links list in the website template.

Completed the backend friend link configuration, next is to display them on the website frontend.AnQiCMS uses a syntax similar to the Django template engine, which can be easily implemented with specific template tags.

  1. Get to knowlinkListTags:AnQiCMS provides a special link forlinkListTemplate tag. This tag is used to extract all configured friendship link data from the background database. Its basic usage method is:{% linkList friendLinks %}...{% endlinkList %}

    HerefriendLinksIs a variable name, you can name it arbitrarily, and the system will assign the data queried from the friendship link to this variable in the form of an array.

    linkListThe tag supports an optional parametersiteIdIf you are using the AnQiCMS multi-site management feature and want to call the friend links under a specific site, you can do so bysiteId="X"Specify (where X is the site ID). For single-site users, this parameter is usually not set.

  2. Traverse the friend link data:Once you pass throughlinkListAfter the tag retrieves the friend link data, it can be used.forto loop throughfriendLinksArray, display the detailed information of each friendship link one by one. Inside the loop,itemThe variable represents each friendship link object being traversed, which contains the following common fields:

    • item.Title: Friend link name.
    • item.Link: Friend link URL address.
    • item.Remark: Friend link remark information (usually not displayed on the front end).
    • item.Nofollow: A boolean value (1indicating yes,0Indicates no, indicating whether the link containsnofollowProperty.
  3. Write template code:The following is a complete template code example showing how to elegantly list friendship links on your website:

    {% linkList friendLinks %}
    {% if friendLinks %} {# 检查是否有友情链接,避免空列表显示标题 #}
    <div class="friend-links-section">
        <h3>友情链接</h3>
        <ul class="friend-links-list">
            {% for item in friendLinks %}
            <li>
                <a href="{{item.Link}}" 
                   {% if item.Nofollow == 1 %} rel="nofollow"{% endif %} {# 根据后台设置添加nofollow属性 #}
                   target="_blank" {# 建议新窗口打开,提升用户体验 #}
                   title="{{item.Title}}"> {# 鼠标悬停显示链接名称 #}
                   {{item.Title}}
                </a>
            </li>
            {% endfor %}
        </ul>
    </div>
    {% endif %}
    {% endlinkList %}
    

    Code description:

    • {% linkList friendLinks %}Get all friend links and assign to:friendLinksVariable.
    • {% if friendLinks %}This is a very practical judgment, only when there are friendship links, will the title and list of 'Friendship Links' be displayed, to avoid blank titles when there are no links.
    • <h3>友情链接</h3>and<ul class="friend-links-list">These are HTML structures and CSS classes, you can adjust them according to your website design.
    • {% for item in friendLinks %}Loop through each link.
    • href="{{item.Link}}"Set the link address.
    • {% if item.Nofollow == 1 %} rel="nofollow"{% endif %}:According to the backend settings, dynamically add links tonofollowProperty.
    • target="_blank":Open the friend link in a new tab to improve user browsing experience.
    • title="{{item.Title}}"When the user hovers over the link, display the link name to increase accessibility.
    • {{item.Title}}Display the text of the friend link.

Third, place the template code in the appropriate position.

You usually place this link template code at the footer, sidebar, or a dedicated links page of the website.

  • Footer (Footer):If your template has a common footer file (for examplepartial/footer.htmlorbash.html), you can put this code in it. This way, all pages will automatically display the links.
  • Sidebar (Sidebar):Similarly, if your website has a sidebar template file (for example), you can also place it there.partial/sidebar.html), you can also place it there.
  • Independent page:You can create a separate page to display all the friendship links.Create a new page in the 'Page Resources' -> 'Page Management' section of the AnQiCMS backend, and embed the above template code in the content or custom template of that page.

Using AnQiCMS providedincludetags, you can flexibly insert these code snippets into different positions on the website. For example, in your main template file, you can use{% include "partial/footer.html" %}Introduce a footer with友情 links.

By following these steps, you can easily manage and display the friend link list in AnQiCMS, which not only helps your website better promote externally, but also provides your visitors with richer navigation information.


Frequently Asked Questions (FAQ)

Why isn't the added friendship link displayed on the front page?

Answer:In this situation, you can check from several aspects.Firstly, please make sure you have added the link in the AnQiCMS background "Function Management" -> "Friend Links".{% linkList friendLinks %}and{% for item in friendLinks %}This code is called.Finally, please try to clear the website cache (there is a "Update Cache" button at the bottom of the left menu in the background), because the system may cache old page content, which may cause the new added links to not be displayed in time.

Question:rel="nofollow"What is the role of properties, should I add them to the friendship link?

Answer: rel="nofollow"The attribute tells the search engine not to pass the weight of your website to the linked website. In SEO practice, when you link to an external website but do not want the search engine to consider that you are 'guaranteeing' or 'recommending' the website, you will usually usenofollow. Regarding friend links, especially those over which you have no control over the quality of content

Related articles

How to display the TDK (title, description, keywords) information of the website in AnQiCMS template?

AnQiCMS is a content management system that pays great attention to SEO optimization, providing strong support for the search engine performance of website content.Among them, TDK (Title, Description, Keywords, that is, title, description, keywords) is a core element of SEO optimization, and it is crucial to display this information correctly in the website template to enhance the visibility of the website in search engines.This article will introduce how to effectively display these TDK information in the AnQiCMS template.###

2025-11-08

How to set and display the navigation menu of the AnQiCMS website, does it support multi-level structure?

The website navigation is an important guide for users when visiting the website, a clear and easy-to-use navigation menu can greatly enhance the user experience.AnQiCMS offers very flexible and powerful functions in terms of website navigation settings and display, allowing us to easily manage and implement multi-level menu structures to meet the needs of various website layouts.In the AnQiCMS backend, all settings related to website navigation are concentrated in the "Navigation Settings" module.Enter this page, you will first see a "navigation category management" area.This feature is very useful

2025-11-08

How to make AnQiCMS automatically publish content at a specific time and display it?

In website content operation, maintaining a regular update and release rhythm is the key to attracting and retaining users.However, manually releasing content at specific time points is not only time-consuming but also prone to limitations imposed by human factors.AnQiCMS provides a very practical feature that can help you easily achieve scheduled content release and automatic display, making your website operation more efficient and automated.

2025-11-08

How to customize the content model in AnQiCMS to achieve diversified content display?

In website operation, the diversity of content is the key to attracting users, enhancing experience, and optimizing search engine rankings.AnQiCMS provides a highly flexible mechanism that allows users to break free from the constraints of traditional content management systems (CMS) such as 'articles', 'products', and other fixed templates. By customizing content models, it can achieve truly diverse content display.Why do we need a custom content model?

2025-11-08

How to use AnQiCMS filters to format and truncate output text content?

In the AnQiCMS content management system, the presentation effect of content often determines the user experience and the efficiency of information delivery.To meet the diverse content display needs, AnQiCMS provides a powerful and flexible template filter function.These filters can help us with fine-grained processing of the original text when displaying content, whether it's adjusting text style, optimizing display length, or performing data conversion, it can be easily achieved.

2025-11-08

How does AnQiCMS ensure the display quality of image resources and perform automatic compression and WebP conversion?

In the era where content is king, the image resources on the website play a crucial role.They not only directly affect the beauty of the page, but are also key factors in determining the loading speed and user experience of the website.For operators, how to ensure the display quality of images while also taking into account the performance and storage costs of the website is undoubtedly a question worthy of reflection.AnQiCMS (AnQiCMS) is well-versed in this, providing a comprehensive image resource management and optimization strategy, aimed at helping users easily master this challenge.The foundation for ensuring the quality of image display

2025-11-08

How to integrate and display Markdown, mathematical formulas, and flowcharts correctly on the AnQiCMS page?

In AnQiCMS, adding Markdown, mathematical formulas, and flowcharts to content greatly enhances its expressiveness and readability, especially for technical documents, educational materials, or data analysis reports.AnQiCMS as an efficient content management system, provides flexible mechanisms to support these modern content display needs. To implement the correct display of Markdown, mathematical formulas, and flowcharts on the AnQiCMS page, it mainly involves enabling backend settings and the necessary introduction of frontend templates.Here are the detailed steps and some practical suggestions

2025-11-08

How to display dynamic breadcrumb navigation in AnQiCMS and customize the home page name?

In website content management, breadcrumb navigation plays a crucial role.It not only helps visitors clearly understand their position on the website, provides a convenient path to return to the upper page, but also reflects the hierarchical structure of the website from the side, which is greatly beneficial to user experience and search engine optimization.AnQiCMS as a powerful content management system naturally provides a flexible way to manage and display this kind of navigation.

2025-11-08