How to display the friend link list in the admin panel of the AnQiCMS website?

Calendar 👁️ 62

On the AnQiCMS website, displaying the list of friend links in the backend management is a very practical feature. It not only helps to improve the website's SEO effect but also provides visitors with more valuable external resources.AnQiCMS provides a simple and efficient mechanism for managing and displaying these links, allowing even new users to easily get started.

To implement the display of friend links, we mainly proceed in two steps: first, configure and maintain the friend links in the AnQiCMS background management system; second, call these links and lay them out in the front-end template files of the website.

Back-end management friendship link

After entering the AnQiCMS admin interface, you will find that all core functions are concentrated in the navigation bar on the left.The management of friend links is located under the "Function Management" menu.Click on "Function Management" and find and select the "Friend Links" option, which is where we add, edit, and delete friend links.

When adding a new friendship link, the system will prompt you to fill in several key pieces of information:

  • Link NameThis is the name displayed on the front end for the友情链接, for example “AnQiCMS official website”.
  • Link AddressThis is the target URL of the友情链接, which is usually a complete website address, such ashttps://en.anqicms.com.
  • Link note: You can add a brief description or tip to the link, which can be used in some templates astitlean attribute display to provide a better user experience.
  • NofollowThis is a very important option.Check this means to tell the search engine not to track this link and not to pass the current website's weight to the target website.When linking to some non-core content, promotional collaborations, or worrying about weight loss on websites, using the Nofollow attribute reasonably helps maintain the SEO health of your website.

After completing the information entry, save to add the friendship link to the list.The backend interface also supports editing, sorting, and deleting existing links, ensuring you can flexibly manage link content.

Link called in front-end template

After the friendship links in the background are properly configured, the next step is to present them on the website's front-end page. AnQiCMS provides a special tag in its powerful template system.linkListCall the friend link data.

The usage of this tag is very intuitive, it needs a variable to carry the data of the friend link, for example, we can name itfriendLinksThe basic calling structure is like this:{% linkList friendLinks %} ... {% endlinkList %}.

InfriendLinksIn this variable, we can access the detailed information of each friendship link by traversing the loop. Each link object includes various fields that we set up in the background, such asitem.Title(Link name),item.Link(link address),item.Remark(Note) anditem.NofollowDid you check the Nofollow attribute?.

Here is a typical example of a friend link list display code block, which is usually placed in the footer template file of a website or a dedicated friend link page:

{% 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 %} target="_blank" title="{{item.Remark}}">
                    {{item.Title}}
                </a>
            </li>
            {% endfor %}
        </ul>
    </div>
    {% endif %}
{% endlinkList %}

In this code block:

  • We first use{% linkList friendLinks %}To retrieve friend link data.
  • {% if friendLinks %}This judgment is to ensure that when there are no friend links set on the backend, the frontend will not display the title 'Friend Links', keeping the page tidy.
  • {% for item in friendLinks %}Loop through each link of friendship.
  • href="{{item.Link}}"Set the target address of the link.
  • target="_blank"Ensure that the link opens in a new window or tab when clicked, to avoid users leaving the current website.
  • {% if item.Nofollow == 1 %}rel="nofollow"{% endif %}Will automatically add to the link based on the backend settingsrel="nofollow"Properties. In the template, boolean fields are usually converted toNofollowFields are usually converted to1(true) or0(false).
  • title="{{item.Remark}}"Set the remark from the background as the link hint information.
  • {{item.Title}}Displays the link name.

To keep the friendship link list consistent with the overall style of the website, don't forget to.friend-links-sectionand.friend-links-listas well as<li>/<a>Label and CSS classes to define styles that integrate into the website design.

By using AnQiCMS's simple and clear backend management and powerful template tag features, displaying the friend link list becomes effortless.Using friendship links wisely can not only help your website perform better in search engines, but also provide visitors with more valuable resources, thereby enhancing the overall user experience.


Frequently Asked Questions (FAQ)

1. If there is no friend link set in the background, will the front-end page display the title 'Friend Links'?No. We specifically added it in the provided template code.{% if friendLinks %}This judgment. It will checkfriendLinksWhether the variable has data, only when the background actually exists friendship links,<h3>友情链接</h3>and<ul>The list will be rendered. If there are no links, the entire friend link area will not be displayed, thus keeping the page tidy.

2. Can I display the friendship links in different groups, such as "Partners" and "Technical Exchange"?According to AnQiCMSlinkListThe current design of the tag, it will uniformly retrieve all the友情链接 configured on the backend, and there is no built-in parameter to directly group them.If you need to implement such grouping display, you may need to add specific identifiers in the background link notes (for example, "Partner-Link Name"), and then manually assign links to different groups in the front-end template through more complex logic (such as string matching) for display.

3. What is the role of the 'Nofollow' option? When should I check it?“Nofollow” is an HTML attribute that tells search engines not to follow or crawl the link, and also not to pass the PageRank (i.e., weight) of the current page to the target website.You should consider checking Nofollow in the following situations: when linking to external websites you cannot fully trust;When the link is an advertisement, a paid link, or promotional in nature; or when linking to a website that is not highly relevant to your website's theme but needs to be displayed.This helps protect the SEO weight of your website and avoid being penalized by search engines for linking to low-quality websites.

Related articles

How to get and display the detailed content and Banner image of a single page in the AnQiCMS template?

In AnQi CMS, it involves understanding the management methods of a single page and mastering the flexible application of template tags to retrieve and display the detailed content of a specific single page and its associated Banner image.AnQiCMS provides an intuitive admin interface and a powerful template engine, making this task simple and efficient. ### In-depth Understanding of AnQi CMS Single Page The "Single Page" feature of AnQi CMS is designed for pages with fixed structures, relatively independent content, and no frequent updates, such as "About Us", "Contact Information", "Service Introduction", and so on.

2025-11-07

How to display all single page lists on AnQiCMS template?

In website operation, we often need to create some independent pages, such as "About Us", "Contact Information", "Terms of Service", or some special introduction pages.These pages are usually called "single-page", their content is fixed, they do not belong to the conventional article or product categories, but they are an indispensable part of the website.When you have accumulated a large number of single pages on your website, you may wish to display a list of these single pages in a specific location, such as the bottom of the website, the sidebar, or even on a dedicated page, to facilitate browsing and searching for visitors.

2025-11-07

How to retrieve and display detailed information about a category, such as the category title, description, and thumbnail, in AnQiCMS?

In AnQi CMS, obtaining and displaying detailed information of a category is an indispensable part of building a dynamic website. Whether it is used to create a category list, a category special page, or display the information of the category in the article detail page, AnQi CMS provides simple and powerful template tags to achieve this. <h3>Deeply understand the `categoryDetail` tag</h3> AnQi CMS template system adopts a syntax similar to Django, where `categoryDetail`

2025-11-07

How to display all articles under a specific category in the AnQiCMS template?

When building a website with AnQiCMS, we often need to make the page content more flexible to meet the display needs of different blocks.One of the most common needs is how to accurately display a list of all articles under a specific category in the template.AnQiCMS with its efficient architecture based on the Go language and similar Django template engine syntax makes this task both intuitive and powerful.

2025-11-07

How to format the article publish timestamp into a readable date and time in AnQiCMS template?

In website content operation, the publication time of articles is often one of the focuses of users, as it not only affects the interest of users in reading but also has a potential impact on the timeliness and authority of the content.However, the time information stored in the database is usually in a machine-readable timestamp format, such as a series of numbers, which is difficult for ordinary visitors to understand.AnQiCMS fully considered this point, providing a flexible way for you to convert these timestamps into clear and easy-to-read date and time formats, greatly enhancing the user experience.

2025-11-07

How to display custom field content (such as author, source) in AnQiCMS templates?

AnQiCMS with its flexible content model and powerful template tag system provides great convenience for personalized display of website content.In website operations, we often need to add some information outside of standard fields for articles, products, or other content, such as the author of the article, source of content, product batch number, or specific SEO information.This non-standardized information, AnQiCMS calls it 'custom fields', they can make your website content more professional, detailed, and meet specific business needs.

2025-11-07

How to implement lazy loading of image content in AnQiCMS templates to optimize performance?

In the digital age, the speed of website access has become one of the key indicators for measuring user experience and search engine rankings.Images are an important part of web page content and often also a major factor affecting page loading speed.When a page contains a large number of high-definition images, the browser needs to load all image resources before rendering the page, which undoubtedly greatly increases the user's waiting time.This problem was solved by the emergence of lazy loading (Lazy Loading) technology.The core idea of lazy loading images is to delay loading images that are not within the current viewport (i.e., the visible area of the user's current screen)

2025-11-07

How to automatically generate and display the content directory (ContentTitles) on the article detail page of AnQiCMS?

## How to automatically generate and display the content directory (ContentTitles) on the AnQiCMS article detail page??For long content, a clear table of contents (also known as "article outline" or "chapter navigation") can greatly enhance the reading experience of users.It not only helps readers quickly understand the structure of the article, but also allows them to directly jump to the chapters of interest, thereby improving the readability and user satisfaction of the content.

2025-11-07