How to manage and display the list of friend links in AnQiCMS?

Calendar 👁️ 64

Friend links are an important part of website optimization and user experience, they not only help your website get a better ranking in search engines, but also provide visitors with more valuable resources, and are also a bridge to establish contacts with industry partners.In AnQiCMS, managing and displaying friend links is a straightforward and flexible operation, allowing you to easily configure these important external connections for your website.

Manage friend link list in the background

To start managing friend links, you need to log in to the AnQiCMS backend.All auxiliary functions are concentrated in the 'Function Management' menu.Click to enter and you will find the option of "Friendship Link Management".

Here, you can easily add, edit, or delete友情链接 (friend links). When you decide to add a new友情链接 (friend link), the system will require you to fill in some key information:

  • Link name:This is the name of your friend link partner website displayed on your site, for example, 'AnQi CMS Official Website.'
  • Link address:That is the complete URL of the other website, for example,https://en.anqicms.com.
  • Note:This is a convenient internal field for you to manage and identify these links, which is usually not displayed on the front end to users. You can write down the characteristics, contacts, and other information of the other website.
  • Nofollow:This is an important option for SEO. If you check this option, it means you are telling the search engine not to track the weight of this link, usually used to avoid passing weight to uncertain content, advertising nature, or links you do not fully trust.This is an option that a responsible website administrator should consider, reasonable use helps maintain the SEO health of your website.

By filling out these fields, you can build a clear and organized friend link library for the website.

Front-end display of friend link list

After setting up the friendship link in the background, the next step is to display them on your website's front page. AnQiCMS provides a special template tag for this—linkListIt can flexibly obtain the friend link data configured in your background.

It should be used in the template.linkListTag, you will usually write it like this:

{% linkList friendLinks %}
    {% if friendLinks %}
    <div class="friendly-links-section">
        <h3>友情链接</h3>
        <ul class="friendly-links-list">
        {% for item in friendLinks %}
            <li>
                <a href="{{item.Link}}" {% if item.Nofollow == 1 %}rel="nofollow"{% endif %} target="_blank">
                    {{item.Title}}
                </a>
                {% if item.Remark %}
                    {# 备注通常不显示在前台,但如果需要,可以这样使用 #}
                    <span class="link-remark">{{item.Remark}}</span>
                {% endif %}
            </li>
        {% endfor %}
        </ul>
    </div>
    {% endif %}
{% endlinkList %}

In this code block,{% linkList friendLinks %}Will fetch all the friend links from the background and store them in a list namedfriendLinksTo avoid displaying an empty title or list when there are no friend links, we first use{% if friendLinks %}Made a judgment.

Then, through aforloop, you can iterate overfriendLinksover each element in the listitem(which is every friend link). Eachitemcontains the following available fields:

  • item.Title: The display name of the友情链接 (friendship link).
  • item.Link: The URL of the友情链接 (friendship link).
  • item.Remark: Notes filled in the back-end, usually not displayed on the front-end, but you can choose to display them as needed.
  • item.Nofollow: A numerical value, if it is1then it indicates that the link has been marked asnofollow, you can use this value to conditionally for<a>tagsrel="nofollow"Property, this is very important for SEO practice. At the same time, in order to provide a good user experience, we usually add properties for external links.target="_blank"Property, so that they can open in a new window.

If you are running a multi-site project and want to display links to other sites on a specific site, you canlinkListthe tag withsiteIdparameters, for example{% linkList friendLinks with siteId="2" %}This will call the friend link list of the site with ID 2.

By using AnQiCMS's simple and efficient backend management and flexible and powerful template tags, setting up and displaying friend links becomes effortless. You can focus on content creation and the overall operation of the website without worrying about these details.


Frequently Asked Questions (FAQ)

1. What is the role of 'Nofollow' in the友情链接 management? When should I check it?

“Nofollow” is an HTML attribute used to inform search engines not to pass on the link weight (PageRank) of your website to the target link.This means you do not acknowledge or guarantee the content of the link. You should consider checking the 'Nofollow' option in the following cases:

  • Paid links or advertisements:Any link that is an advertisement or obtained through sponsorship should use 'Nofollow'.
  • User-generated content:For example, links in comments or forums, you cannot fully control the quality and relevance of their content.
  • Uncertain or low-quality links:If you have doubts about the quality, authority, or relevance of an external website to your site, using "Nofollow" can protect your site.

Using "Nofollow" reasonably helps maintain the SEO health and credibility of your website.

2. Can I display友情链接 (friend links) in multiple different locations on the website (such as the footer and sidebar)?

Yes, you can. AnQiCMS'linkListTemplate tags can be used multiple times in your template file. Just insert the above in any template area where you want to display the friend link (such asfooter.htmlorsidebar.htmlin the code snippet file) above.linkListThe code segment is ok. Each call will retrieve the list of friend links from the background, and you can adjust the style according to the layout needs of different positions.

What will be displayed on the front-end page if I have not added any friendship links in the background?

If you have not added any friendship links in the background, then{% linkList friendLinks %}Tags retrieved from comments.friendLinksThe list will be empty. Because we have added it in the sample code{% if friendLinks %}This judgment, when there is no friendship link on the front page, includes the title of 'Friendship Link' and the entire listdiv.friendly-links-sectionNo area is rendered, thus avoiding the display of an empty or unattractive area, ensuring the page's neatness.

Related articles

How to retrieve and display single-page content in AnQiCMS, such as "About Us"?

In website operation, pages like "About Us" and "Contact Information" are indispensable components. They usually carry relatively fixed and important content such as corporate culture, contact information, and service introduction.For users of AnQiCMS, obtaining and displaying these single-page contents is not only simple and efficient but also highly flexible and customizable.This type of independent page, with content that does not change often, is classified as "single page" by Anqi CMS, and a dedicated management module is provided in the background for easy creation, editing, and publishing by users.

2025-11-08

How to display the publication time of articles in the AnQiCMS template and customize the format?

In website content operation, the publication time of the article is a seemingly simple but crucial detail.It not only affects users' judgment of the timeliness of content, but is also an important reference factor for search engines to evaluate the freshness of content and for ranking.For AnQiCMS users, flexibly displaying and customizing the publication time of articles in templates is a basic operation to improve website user experience and SEO performance.

2025-11-08

How does AnQiCMS control the display of content in different areas through the 'Flag' attribute (such as recommended, headline)?

## AnQiCMS: How to make good use of the "Flag" attribute to accurately control the layout of website content In content operation, it is not enough to just publish articles.How to make important content stand out, how to intelligently display specific content in different areas of the website, is the key to improving user experience and operational efficiency.AnQiCMS is well-versed in this field and has provided us with a powerful and flexible tool - the 'Flag' attribute, to巧妙ly achieve this goal.What is the content "Flag" attribute?In short

2025-11-08

How to enable Markdown editor and correctly render mathematical formulas and flowcharts in AnQiCMS?

Enable the complete guide to Markdown, rendering mathematical formulas and flowcharts in AnQiCMS AnQiCMS, as an efficient and flexible content management system, has been striving to provide more convenient and powerful content editing and display capabilities for content creators.For those who often need to write technical documents, academic papers, or explanations involving complex logic processes, the original rich text editor sometimes feels inadequate.

2025-11-08

How to implement unified management of multi-site content and front-end display in AnQiCMS?

In the current complex and variable network environment, whether it is a large and medium-sized enterprise with multiple sub-brands and business lines, or a self-media operator that needs to create independent content platforms for different audience groups, how to efficiently manage multiple websites and ensure the flexibility and consistency of front-end content display has become a core challenge in content operation.The traditional 'one website, one system' model not only increases the cost of deployment and maintenance, but also makes content collaboration and data analysis extremely complicated.AnQiCMS (AnQi Content Management System) is precisely in such a context

2025-11-08

How to display breadcrumb navigation in AnQiCMS template to optimize user experience?

Have you ever felt lost while browsing a website?On an information-rich website, users sometimes feel overwhelmed, not knowing their current location, and it is also difficult to quickly backtrack to the upper page.This Breadcrumb Navigation is like a guiding light, providing clear path guidance and greatly optimizing their website experience.Breadcrumb navigation is usually displayed in the form of "Home > Category > Subcategory > Current Page", which can help users clearly understand their position in the website structure

2025-11-08

How to set up and display the multi-language switch link in AnQiCMS?

Today, with the increasing popularity of globalization, website multilingual support has become a key to expanding the international market and serving a diverse group of users.AnQiCMS fully considered this requirement, providing flexible multi-language settings and switching functions, allowing the website to easily provide localized content experiences for users of different languages.This article will introduce in detail how to set and display the multi-language switch link in AnQiCMS, and discuss the relevant practical strategies.--- ### Understand the multi-language mechanism of AnQiCMS In AnQiCMS

2025-11-08

How to configure the image watermark feature in AnQiCMS to protect the display of original content?

Today, with content creation becoming increasingly important, how to effectively protect the copyright of original images and prevent unauthorized use has become a focus for many website operators.AnQiCMS (AnQiCMS) fully understands this need, built-in image watermarking function, helps us easily add exclusive marks to images, thus effectively maintaining their exclusivity while displaying original content. Next, we will learn together how to configure the image watermark feature in AnQiCMS, adding a solid protective barrier to your visual content.###

2025-11-08