How to display a list of friend links at the bottom of a website?

Calendar 👁️ 83

In website operation, friend links are an important way to enhance website weight, increase external traffic, and enhance user trust.AnQiCMS (AnQiCMS) provides convenient features, allowing you to easily display these valuable external links at the bottom of your website.

Step 1: Add and configure the friend link in the background management interface

First, we need to add and manage the friend links in the Anqi CMS backend management system. This is like preparing the content list that you will display on the website.

  1. Log in to the backend:Log in to the Anqi CMS backend using your administrator account.
  2. Enter feature management:In the left navigation bar, find and click the 'Feature Management' menu item.
  3. Select the friend link:In the "Function Management" page, you will see an option called
  4. Add or edit a link:
    • Click the 'Add Friend Link' button to start creating a new link.
    • You need to fill in the following information:
      • Link Name (Title):This is the name displayed on the website for the link of friendship, it should be concise and clear, usually the name of the other website.
      • Link Address (Link):Enter the complete URL address of the other website, for examplehttps://www.example.com.
      • Link remark (Remark):Can be a brief description about this link, convenient for your own management, usually not displayed on the front end.
      • Is Nofollow (Nofollow):This is an important SEO option. If this option is checked, the link will be added withrel="nofollow"Attribute, tells the search engine not to track the link passing weight. It is usually recommended to check this box for external友情 links to avoid excessive weight transfer and control SEO risks.

After completing the information entry, click save, your friendship link will be successfully added to the background database.You can repeat this step to add more links, and you can also come back to edit or delete existing links.

Step 2: Call and display the friend link list in the website template

Next, we need to display the友情链接(friendship links) added in the background on the website's front page. This usually involves modifying the website's template files.

  1. Confirm the display location:The friend link list is usually placed in the footer area of the website. In AnQi CMS, the footer content is often in an independent template fragment file, such aspartial/footer.htmlorbash.htmlIf your template uses this common code structure.

  2. UselinkListTags:Anqi CMS provides a special template tag for calling friend links.linkList. This label is very intuitive and can retrieve all the friend link data you have configured on the backend.

    You can use the following code to add the friend link list to your template file:

    {% linkList friendLinks %}
        {% if friendLinks %}
        <div class="footer-links"> {# 可以为友情链接列表添加一个容器以便样式控制 #}
            <h3>友情链接</h3>
            <ul>
                {% for item in friendLinks %}
                <li>
                    <a href="{{item.Link}}" {% if item.Nofollow == 1 %} rel="nofollow"{% endif %} target="_blank">{{item.Title}}</a>
                </li>
                {% endfor %}
            </ul>
        </div>
        {% endif %}
    {% endlinkList %}
    

    Let's decode this code:

    • {% linkList friendLinks %}This is the label called to call the friend link list.friendLinksIt is the variable name you define for this list, and you will access the link data through this variable later.
    • {% if friendLinks %}This is a conditional judgment. It checksfriendLinksDoes the variable have data (i.e., whether the background has added a friend link).This can avoid displaying an empty 'Friend Links' title or a blank area when there are no friend links, enhancing the page's neatness.
    • <div class="footer-links">...</div>This is an HTML structure used to wrap the list of friendship links. You can customize the CSS class for your website design, to control its style and layout.divAdd a custom CSS class to control its style and layout.
    • <h3>友情链接</h3>A simple title, clearly indicating that this part of the content is a friendship link.
    • <ul>...</ul>and<li>...</li>A standard HTML unordered list structure, each<li>contains a friendship link.
    • {% for item in friendLinks %}This is a loop label, it will iterate overfriendLinksEach link data in the variable and name ititem.
    • <a href="{{item.Link}}" ... >{{item.Title}}</a>This is the actual HTML code displayed for the link
      • {{item.Link}}Dynamically outputs the link address set in the background.
      • {{item.Title}}: Dynamically outputs the link name set in the background.
      • {% if item.Nofollow == 1 %} rel="nofollow"{% endif %}: This is a conditional judgment, if the link is set tonofollow, then it will be<a>automatically added in the tag.rel="nofollow"Property.
      • target="_blank"This attribute will open the link in a new window or tab, helping users to stay on your website.
    • {% endfor %}Loop end tag.
    • {% endif %}End tag for conditional judgment.
    • {% endlinkList %}:linkListThe end tag of the label.
  3. Save and update the cache:After modifying the template file, be sure to save the changes. To ensure that the front-end page reflects your changes immediately, it is recommended that you log in to the Anqi CMS backend, click 'Update Cache' to clear the system cache.

By following these steps, you can elegantly display your friend link list at the bottom of the website built with Anqi CMS.This can effectively manage external links and also help improve the website's SEO performance and user experience.

Frequently Asked Questions (FAQ)

  1. I added a friend link in the background, but the front page did not display. What could be the reason?There are usually several possible reasons: First, please confirm whether you have added it to the correct template file (such asfooter.htmlorbash.html)linkListLabel code. Next, check for syntax errors, such as spelling mistakes or unclosed tags.Finally, after modifying the template file, please make sure to go to the "Update Cache" feature in the background management interface, clear the website cache, so that the front-end can load the latest template content.
  2. Can the order of the display of friend links be adjusted?In the current friendship link management interface of Anqi CMS, links are usually displayed in the order of addition or default ID order.If you need to customize the sorting, you may need to adjust it individually through the backend editing function, or use the sorting function of the template after obtaining the data (if your template engine version supports it) for secondary processing. CurrentlylinkListThe tag itself does not provide directorderparameters to control sorting.
  3. Can the友情链接 links be grouped and displayed, such as the "Partners" and "Technical Support" groups? linkListThe current design of the label is to retrieve the unified list of all友情链接 links from the background, without built-in direct grouping parameters to distinguish the display. If you have a need for grouped display, you can consider two methods:
    • Method one (recommended):When adding a friendship link in the background, use the 'Link Note' field for marking, such as noting it as 'Partner' or 'Technical Support'. Then, after obtaining all the links in the template, throughifConditional judgmentitem.RemarkThe content is used to manually group and display.
    • Method two (advanced):If your business logic is very complex and requires more flexible group management, you can consider using the custom content model or custom field function of AnQi CMS to create a module specifically for "external cooperation" or "partner", and manage and call links with grouping attributes through this module.

Related articles

How to automatically add image watermarks or anti-capture interference codes to front-end article content?

Protect originality, how can Anqi CMS automatically add watermarks and anti-crawling interference codes to your article content In the era where content is king, original content is the core competitiveness of a website.However, the arbitrary collection and misuse of content has become a pain point for many website operators.This violates copyright, may dilute the SEO value of original content, and even damage the brand image.Anqi CMS understands the value of content originality, therefore the system is built with powerful anti-crawling and watermark management functions to help you protect your intellectual property rights from the source

2025-11-07

How to enable Webp format conversion in website content images to improve loading speed?

In website operation, image loading speed is one of the key factors affecting user experience and search engine ranking.The traditional JPG and PNG formats are widely used, but they are often less efficient in file size compared to some modern image formats.WebP is an advanced image format developed by Google that can significantly reduce the file size of images while maintaining image quality, thereby significantly improving the loading speed of web pages.For a content management system, if it can easily support WebP conversion, it will undoubtedly greatly reduce the optimizer's burden.

2025-11-07

How to implement different templates for displaying websites on PC and mobile endpoints?

How to ensure that your content is presented in a**state**on different devices is a crucial issue in website operation.With the popularity of mobile devices, the change in user habits requires that websites not only perform well on the PC side, but also provide a smooth and friendly experience on mobile devices.AnQiCMS (AnQiCMS) is well-versed in this field, providing us with flexible solutions, especially since it supports three main website modes: adaptive, code adaptation, and PC + mobile independent site mode, allowing us to use different templates for PC and mobile ends according to specific needs

2025-11-07

How to display the Banner or carousel image for a category on the category page?

In website operation, the category page is an important entry for users to browse content and understand the website structure.A visually appealing, theme-specific category page banner or carousel image that can significantly enhance user experience, strengthen brand image, and effectively guide users to explore more content.AnQiCMS as an efficient and flexible content management system provides a very convenient way to display these images on category pages.This article will cover both the backend settings and the frontend template calls from two aspects

2025-11-07

How to display personalized information on the front end based on the custom content model fields in the backend?

## Unveiling AnQi CMS: How to skillfully use custom fields in the backend to create personalized front-end content display In today's rapidly changing digital world, a website is not just a carrier of information, but also a window for brand personality and user experience.Traditional website content management systems (CMS) are often limited by fixed content structures and are difficult to meet the diverse business needs.However, AnQiCMS (AnQiCMS) has opened a new door to personalized content display for website operators with its flexible content model and powerful custom field features.

2025-11-07

How to display the article summary instead of the full text on the search results page?

How to make users quickly understand the content of the article on the search results page without directly displaying the full text, which is not only related to user experience but also a key factor in search engine optimization (SEO).For those using AnQiCMS, achieving this is very flexible and efficient.

2025-11-07

How to display the user's submitted comment content and avatar in the website comment section??

Displaying user comments on the website is a key element in enhancing user interaction and content vitality.For websites using AnQiCMS, its powerful template tag system makes this operation intuitive and flexible.This article will thoroughly introduce how to clearly display user-submitted comments in the website's comment section, accompanied by their unique avatars, thereby enriching the website's user experience.--- ### Understanding the Basics of AnQi CMS Comment Function Firstly, we need to understand how comment content operates in AnQi CMS

2025-11-07

How to format the display of the article's publish time in the template, for example “2023 June 1st”?

When operating a website, the time an article is published is often one of the important pieces of information that users are concerned about.A clear and readable time format not only enhances user experience but also helps to improve the professionalism of website content.AnQi CMS is an efficient and customizable content management system that provides a flexible way to control the display of various information in templates, including the publishing time of articles.

2025-11-07