How to display the friend link list at the bottom of the AnQiCMS website?

Calendar 👁️ 64

In website operation, friendship links play an indispensable role.It is not only an effective way for websites to recommend and share traffic among each other, but also an important means to enhance the weight and visibility of a website in search engines.However, how to conveniently manage and display these links on a website is a practical problem faced by many website managers.AnQiCMS is a system focused on enterprise-level content management and SEO optimization, providing an intuitive friend link function and a flexible template calling mechanism, making this process extremely simple.

Friend link management in AnQi CMS

To display the友情链接 on the bottom of your website, you first need to configure these links in the AnQiCMS backend system.

  1. Enter the backend managementLog in to your AnQiCMS backend, you can usually find the 'Function Management' menu in the left navigation bar.
  2. Visit 'Friend Links':Click on the 'Function Management' sub-menu under 'Friend Links', you will enter the management interface for Friend Links.
  3. Add and editOn this interface, you can easily add new friendship links, or edit and delete existing links. When adding or editing, you need to fill in the following key information:
    • Link NameThis is the text that will be displayed on your website, used to describe the friendship link.
    • Link AddressThis is the complete URL address pointed to by the friendship link.
    • Link noteThis is an optional internal note field, convenient for you to manage and identify different links, it will not be displayed on the website front end.
    • NofollowThis is a very important SEO option. Checking this option will inform the search engine not to pass the weight of your website to the website linked by the link.This is very useful when linking to business partners, advertisements, or websites you do not want to provide SEO benefits to.

Configure all the necessary friend links and save your changes.

Call the friend links in the website footer template

AnQiCMS uses the Django template engine syntax, which means you can call the background configuration data in template files through concise tags.To display the friend link list at the bottom of the website, you need to make corresponding modifications to the template file.

  1. Confirm the footer template fileIn the AnQiCMS template root directory (usually/template/您的模板名称/), find the template file responsible for displaying the bottom area of the website. Common public footer file paths may bepartial/footer.htmlor directly integrated inbase.htmlIn Chinese. If you are not sure which file it is, you can check the template directory structure or checkbase.htmlpass through{% include %}The common part introduced by the tag.

  2. InsertlinkListTagIn the bottom template file found, select a suitable position to display the friend links, such as above the copyright information. Then, insert the following template code:

    {% linkList friendLinks %}
        {% if friendLinks %}
            <div class="footer-friend-links-section">
                <h4>友情链接</h4>
                <ul class="friend-links-list">
                    {% 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 the meaning of this code:

    • {% linkList friendLinks %}This is a built-in template tag that is used to retrieve all the configured friend link data from the AnQiCMS backend and assign these data as a list to a variable namedfriendLinks.
    • {% if friendLinks %}This conditional judgment statement is very practical. It will checkfriendLinksWhether a variable contains any data. If no friend links are set in the background or the number of links is zero, the entire friend link area (including the 'Friend Links' title and list) will not be displayed on the website, avoiding blank pages or unnecessary elements.
    • <div class="footer-friend-links-section"> ... </div>and<h4>友情链接</h4>This part is an HTML structure used to wrap the list of friend links and provide a title. You can adjust it according to your website design and style requirements.
    • {% for item in friendLinks %}This is a loop tag, it will iterate overfriendLinkseach friendship link item in the list. In each iteration, all information of the current link will be temporarily assigned toitemVariable.
    • <li> ... </li>Each friendship link is wrapped in a list item.<li>.
    • <a href="{{item.Link}}" {% if item.Nofollow == 1 %} rel="nofollow"{% endif %} target="_blank">{{item.Title}}</a>This is the core code for displaying a single friendship link.
      • href="{{item.Link}}"Dynamically outputs the URL address of the friendship link.
      • {{item.Title}}: Dynamically outputs the name of the friendship link.
      • {% if item.Nofollow == 1 %} rel="nofollow"{% endif %}: This is an important conditional judgment. If the "Nofollow" option is checked for this link (indicatingitem.Nofollowhas a value of 1), then<a>Labels will be automatically addedrel="nofollow"Property.
      • target="_blank"It is usually good practice to open friend links in a new window or tab so that users visiting friend links will not leave your current website.

Save and view effects

After modifying the template file, please save the file. If your AnQiCMS is deployed in a production environment and page caching is enabled, you may need to clear the website cache (which can be found in the "Update Cache" feature of the AnQiCMS backend, or through server operations) to make the changes take effect. Refresh your website homepage, and you should see the new list of友情链接(friendship links) added at the bottom.

Summary

By using the intuitive backend management interface and powerful template tag features of AnQiCMS, you can efficiently and flexibly display友情链接 at the bottom of your website.This integrated solution not only simplifies the management process, but also helps you better optimize the external link strategy of your website through detailed SEO options, thereby improving the overall website operation effect.


Frequently Asked Questions (FAQ)

1. Q: Can I control the number of displayed friend links, such as showing only 5 or 10 of them?

Answer:linkListThe tag itself does not provide directlimitParameters can limit the number of items retrieved. If you want to control the number of items displayed, you can use loop variables in the template's{% for item in friendLinks %}loop, using loop variables (for exampleforloop.CounterPerform a conditional judgment. For example, if you want to display only the first 5 links, you can modify it like this:{% for item in friendLinks %} {% if forloop.Counter <= 5 %} <li>...</li> {% endif %} {% endfor %}Or directly inforAdd in the loopsliceFilter to slice the array:{% for item in friendLinks|slice:":5" %}.

2. Ask: I hope to display my friend links in groups, such as 'Partners' and 'Industry Media', does AnQiCMS support this?

Answer:linkListThe tag retrieves all the友情链接 links from the backend, does not have built-in grouping functions.To implement grouped display, a common method is to use the "link note" field when adding friend links in the background to add group tags to each link (for example: "Partners" or "Industry Media").Then in the template, you can write multiple separatelylinkListtags, and according to the loop insideitem.RemarkThe value is used for conditional judgment to filter and display:{% for item in friendLinks %} {% if item.Remark == "合作伙伴" %} <li>...</li> {% endif %} {% endfor %}You can also usefilterFilter combinationcontainFilter to achieve more flexible filtering effects.

3. Ask: What is the specific function of the 'Nofollow' attribute in the friendship link? When should I check it?

Answer: 'Nofollow' is an HTML<a>A tag attribute that indicates to the search engine not to follow the link and not to assign any "weight"

Related articles

How does AnQiCMS display the website message form and customize the form field display?

AnQi CMS: Flexible display and field customization of the website message form In website operation, the message form is an important bridge connecting users and the website.Whether it is to collect customer feedback, provide consulting services, or interact with users, a well-functioning and easy-to-use comment form is particularly important.AnQiCMS (AnQiCMS) is well-versed in this field, providing users with a powerful and flexible feedback form feature, which can be easily displayed on the website front-end and supports in-depth customization of form fields to meet various business needs.### One,

2025-11-08

How to display the Tag list of articles and detailed information of a single Tag as well as associated documents in AnQiCMS?

How to effectively organize and display content in a content management system is the key to improving user experience and search engine friendliness.AnQiCMS provides a powerful Tag feature, helping us to classify and display content more finely.This article will provide a detailed introduction on how to flexibly use tags in AnQiCMS, including displaying tag lists, viewing detailed information of individual tags, and listing documents associated with specific tags.The role of tags in AnQiCMS Tags are a flexible content organization method in AnQiCMS

2025-11-08

How does AnQiCMS's 'Document Parameter Filtering' feature help users perform combined filtering of content lists on the front end?

Today, with the rich content of websites, how to help visitors quickly and accurately find the information they are interested in has become a key challenge in content operation.Imagine if your website had thousands of articles, products, or cases, and visitors could only filter through them with simple categorization and search, it would undoubtedly greatly reduce their exploration efficiency and satisfaction.AnQiCMS is well-versed in this field and has provided us with a highly efficient and flexible solution - the "document parameter filtering" feature.This feature is like an intelligent guide, able to meet various conditions we preset

2025-11-08

How to loop through custom parameters of articles in a template (such as author, source)?

In AnQi CMS, flexibly displaying customized article parameters is the key to enhancing the personalization and information richness of the website content.In order to better describe product features, or to clearly mark the author and source in an article, custom parameters can provide strong support.The AnQi CMS provides a simple and efficient way to define and call these parameters, allowing you to easily display them in website templates. Next, we will step by step discuss how to implement the loop display of article custom parameters in Anqi CMS template.### Step 1

2025-11-08

How to apply AnQiCMS pagination feature to the pagination display of article lists or Tag document lists?

In website content management, whether it is to display a large number of articles, products, or documents under categories, an efficient and user-friendly pagination function is crucial.It not only allows users to easily browse a large amount of content, avoid the slow loading caused by long pages, but also helps search engines better crawl and index website information.AnQiCMS is well-versed in this, providing intuitive and powerful pagination functions in template tag design, making it effortless to implement pagination display in article lists or Tag document lists.Understanding how AnQiCMS implements pagination

2025-11-08

How to use if/for tags in a template to control the conditional display and looping display of content?

When building and operating a website, the dynamic display and flexible management of content are key to improving user experience and operational efficiency.AnQiCMS (AnQiCMS) understands this point, therefore its template engine provides powerful and intuitive conditional judgment (`if`) and loop traversal (`for`) tags, allowing you to easily control the display logic of content and achieve highly customized page layouts.The template syntax of AnQi CMS borrows the concise style of Django template engine, with a very low learning cost.By mastering these core tags

2025-11-08

How to format a timestamp into a readable date and time format for display in AnQiCMS?

The website content is updated frequently, each article, product, or comment has its creation and update time point.However, these times are usually stored in the background in the form of a series of numbers, which is what we commonly call timestamps.It is not friendly to display these timestamps to visitors, we need to convert them into a clear date and time format.In AnQiCMS, formatting these timestamps into the date and time format we are accustomed to is actually very simple and intuitive.The system comes with a powerful template tag that can help us easily achieve this.###

2025-11-08

How to define temporary variables in templates to assist in content display logic?

When using AnQiCMS for website content management, the flexibility of the template is crucial for achieving diverse content display.At times, we need not only to output data directly, but also to perform some temporary processing, calculation, or judgment based on business logic, at which point defining temporary variables in the template becomes particularly useful.This not only makes the template code more tidy, but also avoids repeated retrieval or calculation of the same data, thereby improving rendering efficiency and maintainability.The template engine syntax of AnQi CMS is similar to Django template engine

2025-11-08