How to display the friend link list on the AnQiCMS website?

Calendar 👁️ 65

Friendship links are an indispensable part of website operation, they can not only promote communication and cooperation between websites, but also have a positive effect on SEO optimization.In AnQiCMS, displaying the friend link list is a simple and efficient process, allowing website administrators to easily provide visitors with more valuable external resources.

Backstage management: Configure your friend links

In AnQiCMS, you first need to configure the friend link in the background before it can be displayed on the front page. This process is very intuitive:

In the left menu of the background management interface, you can find the itemfunction managementClick to enter, in one of the sub-functions, you will see theFriendship Linkmanagement entry.

Here, you can easily add, edit, or delete the website's友情链接 (friend links). When adding a友情链接, it is usually necessary to fill in the link'sTitle(which is displayed on the website),Link Addressand you can choose whether to enableNofollowattributes (this is very important for SEO optimization, controlling weight transfer), and you can also add a brief note for the link.

The system also supports API interfaces for adding and deleting friend links, providing convenience for scenarios requiring automated management.

Front-end display: uselinkListTag call

Once the background configuration of the friend link is done, the next step is to display them on the website's front page. AnQiCMS provides a special template taglinkListto help you easily achieve this.

You just need to use the template file that needs to display friendship links (such as the website footer templatefooter.htmlor a dedicated page template) and use the{% linkList friendLinks %}...{% endlinkList %}tag.friendLinksIs a variable name that you can customize, it will carry all the friendship link data obtained from the background, displayed in a list form for looping display.

Each friend link object contains the following key information, you can call it in the template as needed:

  • Title: The display name of the link.
  • Link: The URL address of the friend link.
  • RemarkLink note information (usually not displayed on the front end).
  • NofollowA boolean value (1 for yes, 0 for no), indicating whether the link hasrel="nofollow"Property.

Here is an example of a template code to display a list of friendship links:

{% linkList friendLinks %}
    {% if friendLinks %} {# 检查是否存在友情链接,避免空列表出现 #}
    <div class="friendly-links">
        <h3>友情链接</h3>
        <ul>
            {% for item in friendLinks %} {# 循环遍历每个友情链接 #}
            <li>
                {# 使用item.Link作为链接地址,item.Title作为显示文本 #}
                {# 根据item.Nofollow的值,动态添加rel="nofollow"属性 #}
                {# target="_blank" 让链接在新窗口打开,提升用户体验 #}
                <a href="{{ item.Link }}" {% if item.Nofollow == 1 %}rel="nofollow"{% endif %} target="_blank">{{ item.Title }}</a>
            </li>
            {% endfor %}
        </ul>
    </div>
    {% endif %}
{% endlinkList %}

In the code above,{% linkList friendLinks %}The tag is used to retrieve the friendship link list configured in the background and assign it tofriendLinksVariable.{% if friendLinks %}Ensure that only the relevant HTML structure is rendered when there are friend links present, to avoid unnecessary whitespace or titles on the page. Then,{% for item in friendLinks %}Loop through each link, through{{ item.Link }}and{{ item.Title }}Output the link address and display name. Particularly, we have implemented{% if item.Nofollow == 1 %}rel="nofollow"{% endif %}dynamic addition based on background settingsnofollowproperties, and throughtarget="_blank"The link opens in a new window, improving the user experience.

Practical considerations and advanced usage

  • SEO-friendliness: As mentioned earlier,NofollowThe rational use of properties is crucial for SEO. For external links that you do not want to pass weight or cannot fully trust, it is necessary to enable it in the background.NofollowAnd render the property correctly in the template.
  • Multi-site Support:AnQiCMS supports multi-site management. If you have created multiple sites in the system and need to call the friend links of a specific site, you canlinkListUsed in tagssiteIdparameters, for example{% linkList friendLinks with siteId="2" %}Specify the site ID you want to call.
  • Page layout and style: Friend links are usually located at the bottom of the website. You can use appropriate CSS styles to beautify the friend links list, making it harmonious with the overall design style of the website.in the example code provideddivandulTags are just structural examples, you can adjust their class names and styles as needed.

By following these steps, you will find that AnQiCMS provides great flexibility and convenience in displaying the friend link list.Whether it is to manage link content or to personalize the display on the front end, AnQiCMS can help you a lot, optimize your website structure, and improve the user experience.


Frequently Asked Questions (FAQ)

  1. Is the friend link supported for image links?Based onlinkListThe fields available for tags (Title,Link,Remark,Nofollow), AnQiCMS default friend link function mainly displays links in text title format.The system does not provide a dedicated picture field for uploading pictures directly as a link.However, when you manage the friendship link in the background, you can set the "title" field of the link to include<img>The HTML code of the tag to achieve the effect of image links, but this is not the original image field supported by the system.

  2. How to control the display order of friendship links?The friendship link management interface of AnQiCMS backend usually provides sorting function, you can adjust the display order of links directly in the background.linkListLabels will be displayed in the order configured on the backend automatically, without the need to set additional sorting parameters in the template. Therefore, if you want to adjust the display order, you just need to go to the backend to operate.

  3. How to open friendship links in a new window?To enhance user experience, it is usually recommended to open friend links in a new window to prevent visitors from leaving your website. In the template code, you can<a>in the tag.target="_blank"This is achieved by the attribute. As shown in the example code in the article, just make sure your<a>tag containstarget="_blank"Just do it.

Related articles

How to display single page content in AnQiCMS, such as the "About Us" or "Contact Us" page?

Displaying single-page content such as 'About Us' or 'Contact Us' in AnQiCMS is a very intuitive and flexible process.The system is designed to meet the needs of such static information display, through simple backend management and powerful template rendering capabilities, allowing you to easily create and beautify these important web pages. ### Create and Manage Single Page in the Back-end Firstly, all the content of single pages needs to be created and managed in the AnQiCMS back-end.

2025-11-07

How to implement lazy loading (lazyload) feature in AnQiCMS article content?

On your AnQiCMS website, optimizing image loading is a key step to improving user experience and website performance, especially for pages with a large number of image content.The Lazy Load (Lazy Load) technology is an efficient solution that allows the page to only load images within the user's viewport, while deferring the loading of images outside the viewport until the user scrolls near them.This can significantly reduce the initial page loading time, save bandwidth, and improve the overall website response speed.

2025-11-07

How to enable Markdown editor in AnQiCMS and ensure that mathematical formulas and flowcharts are displayed correctly on the webpage?

AnQiCMS provides a flexible and diverse editing experience for content creators, and the introduction of the Markdown editor has made it even more convenient for many users who are familiar with this concise markup language.However, simply enabling the Markdown editor is not enough for content that requires special rendering, such as mathematical formulas and flowcharts.This article will provide a detailed guide on how to enable Markdown editor in AnQiCMS and ensure that your web page can correctly and beautifully display complex mathematical formulas and flowcharts.### One, Enable

2025-11-07

How to display the current page's TDK (Title, Description, Keywords) information in AnQiCMS template?

In website operation, the TDK (Title, Description, Keywords) information of the website plays a vital role.They are not only the key for search engines to understand the content of the page, but also a critical factor for users to decide whether to click on your website in the search results.A well-optimized TDK can significantly improve a website's ranking in search engines and attract more target users.AnQiCMS (AnQiCMS) is a content management system designed for SEO optimization, naturally providing strong and flexible support for TDK management

2025-11-07

How to generate and display breadcrumb navigation in the AnQiCMS template?

In website operation, a clear navigation structure is crucial for improving user experience and search engine optimization (SEO).Imagine if, when visitors delve deep into your website, there was a path guide to tell them 'You are here', wouldn't that make them feel at ease and convenient?This is the function of Breadcrumb Navigation.It is like breadcrumbs scattered in fairy tales, helping users easily backtrack in the website and understand the position of the current page in the overall website structure.

2025-11-07

How to display the unique field content according to a custom content model?

AnQi CMS with its powerful content management capabilities, especially the flexible content model, makes the organization of our website content simpler than ever before.When the standard content field cannot meet specific business needs, a custom content model and its unique fields emerge.How can you accurately call and display these unique custom field contents in the website front-end template?This article will detail the mysteries revealed for you. ### 1. Understanding the content model and custom fields of AnQi CMS One of the core strengths of AnQi CMS is its highly flexible content model

2025-11-07

How to call and display data from different sites in AnQiCMS multi-site management?

AnQiCMS (AnQiCMS) as an efficient and flexible content management system, its powerful multi-site management function is undoubtedly a highlight favored by many operators.When we hold multiple brand, multiple region, or multiple theme websites, we can manage them uniformly through a system and flexibly call and display data between different sites, which will greatly improve work efficiency and content integration.How can we implement the calling and display of data between different sites in the AnQiCMS multi-site environment?### Understanding the core of multi-site data calls

2025-11-07

How to loop through and display the article tag list in AnQiCMS templates?

In Anqi CMS, article tags are not only a tool for organizing content and improving user experience, but also an important element for optimizing search engine crawling and ranking (SEO).They can help visitors quickly find relevant content and can also help search engines better understand the website structure.How can I flexibly loop through and display these article tag lists in the AnQiCMS template?This is actually simpler than you imagine, the powerful template tag system of AnQiCMS makes everything very intuitive.

2025-11-07