In website operation, friend links play an indispensable role. They are not only the bridges to establish connections with other websites but also effective ways to improve website authority, obtain external traffic, and enhance user experience.AnQiCMS as an efficient and flexible content management system provides an intuitive and convenient solution for the integration and display of friend links.

The first part: Back-end management friend links

One of AnQiCMS's design philosophies is to make website operations more efficient, and the management of friendship links is naturally integrated very well.To set up and manage friend links, you just need to log in to the AnQiCMS backend management interface.

In the left navigation bar of the background management interface, you can find the "Function Management" module.Click to expand and you will see the item 'Friendship Link Management'.This is where you can centrally manage all your friend links.

After entering the page, you can easily add new friend links. Typically, each link contains several key pieces of information:

  • Link name:This is the text displayed on the front end for the friend link, it should be clear and intuitive.
  • Link address:It is crucial to ensure that the complete URL of the target website pointed by the friendly link is accurate.
  • Link remark:This content is mainly used for internal management and identification on the backend and will not be displayed on the website frontend.
  • Is Nofollow:This is a very important option, especially when considering SEO.Check 'Nofollow' means you are telling the search engine not to track this link and not to pass your website's weight to the target website.For sites you do not want to pass SEO weight to, or external links whose content is not fully trusted, it is strongly recommended to check this option to avoid potential SEO risks.

Through the "Friend Link Management" feature, you can edit, delete, and other operations on the links added, ensuring the timeliness and relevance of the link list.

The second part: Displaying友情links in the template

Managed the friend links, the next step is how to display them on your website's frontend.AnQiCMS uses a syntax similar to the Django template engine, making content display both flexible and powerful.You only need to use the specific tags provided by AnQiCMS in the template files where you need to display the friendship links.

To display the友情links list, you need to uselinkListLabel. This label will provide you with all the friend link data managed by the background, and you can use the template'sforloop structure to traverse and display each one sequentially.

Here is a commonly used code example that shows how to integrate and display a list of friend links in your website template:

<div class="friendly-links-section">
    <h3>友情链接</h3>
    <ul class="link-list">
        {% linkList friendLinks %}
            {% if friendLinks %} {# 建议添加此判断,以防没有友情链接时页面显示空列表 #}
                {% for item in friendLinks %}
                    <li>
                        <a href="{{ item.Link }}" target="_blank" {% if item.Nofollow == 1 %}rel="nofollow"{% endif %}>
                            {{ item.Title }}
                        </a>
                    </li>
                {% endfor %}
            {% else %}
                <li class="no-links">暂无友情链接</li>
            {% endif %}
        {% endlinkList %}
    </ul>
</div>

Code explanation:

  • {% linkList friendLinks %}This is the core tag, it retrieves all the friend link data and assigns it tofriendLinksVariable.
  • {% if friendLinks %}This is a conditional judgment, checkingfriendLinksThe variable contains data. If the list is empty, then display 'No friend links available', to avoid blank pages or errors.
  • {% for item in friendLinks %}: PassforLoop throughfriendLinksEach item in the collection, and assign the current item toitemVariable.
  • {{ item.Link }}: Output the address of the current link.
  • target="_blank"This is a standard HTML attribute that indicates opening a link in a new tab. This is a good user experience for external links.
  • {% if item.Nofollow == 1 %}rel="nofollow"{% endif %}: This condition judgment is used again. If the background has set the properties for this friend linkNofollow(that isitem.NofollowThe value is1),then it will be in<a>the tag withrel="nofollow", to inform the search engine not to pass the weight
  • {{ item.Title }}: Output the name of the current friend link.

The third part: Practical Application and Optimization Suggestions

Adding and displaying friendship links is not enough, a good website operator will also consider how to better utilize them to serve the website:

  • Regularly check and update:The status of the link is not eternal.You should regularly check that all友情links are still valid, whether the content of the target website is healthy, and whether the other party is still maintaining your link.Invalid links should be removed or updated promptly.
  • Prioritize link quality:The quantity is important, but the quality of the connection is more crucial.Choose websites for link exchange that are relevant to your website content, have high weight, are frequently updated, and provide a good user experience.Low-quality links may actually harm your website's reputation.
  • Reasonable layout:It is not advisable to have too many友情链接, usually placed at the bottom of the website is a common practice, which can meet some users' search needs without diverting attention from the main content.If the number is large enough, consider creating a separate "friend links" page.
  • Diversified link sources:In addition to friendship links, you can also attract natural backlinks by publishing high-quality content, or by participating in industry communities, etc., to enrich the external link ecology of the website.

AnQiCMS provides intuitive and convenient backend management and flexible template call tags for integrating and displaying friend links, helping you easily achieve the basic functions of website operation.Make good use of this feature, it will help your website develop healthily.


Frequently Asked Questions (FAQ)

1. Why did I add a link but the website front-end did not display it?

First, make sure you have successfully added and saved the friend link in the background "Function Management" -> "Friend Link Management". Secondly, the most common reason is that you did not use the website template correctly.linkListLabel or the way the label is used is incorrect. Please check your website template (such as the footer file) or the template for the dedicated friends link pagefooter.htmlwhether it contains similar{% linkList friendLinks %} ... {% endlinkList %}The code should be checked for spelling errors. Additionally, make sure your template cache is updated.

2. What is the role of the 'Nofollow' attribute in friendship links, should I check it?

The \If you exchange a link with a website you do not fully trust, or a website that is not directly related to the content, or if the quality of the other website is poor, it is a wise choice to check the 'Nofollow' attribute.This helps protect the SEO weight of your website, avoiding being implicated due to linking to bad websites.For commercial性质的付费链接,it is usually recommended to set to “Nofollow”.

3. Can I display different friendship link lists for different pages or categories?

The AnQiCMS backend's friend link management feature is shared across the entire site,linkListThe label will default to getting this unified list.This means you cannot set independent friend link groups for different pages or categories directly in the background.