How does Anqi CMS display and manage website friend links?

Next, we will delve into how to manage the link function of Anqi CMS in the background, and how to flexibly display it on the website front-end, providing you with a detailed explanation of its function.

Manage friend links: Overview of background operations

It is very simple to manage friend links in AnQi CMS.You can find 'Function Management' in the left navigation bar of the background management interface, click on it, and you will see the option 'Friendship Link Management'.

  • Link Name (Title): This is the text name displayed to visitors on your website for the friend link, such as 'AnQi CMS Official Website'.
  • Link AddressThis is the actual URL pointed to by the friend link, please be sure to fill in the complete and correct address, for examplehttps://en.anqicms.com.
  • Remark for LinkThis is an optional internal note field, usually used to record additional information for links, such as the name of the partner, contact information, etc. These details are not displayed on the website frontend by default.
  • Nofollow (Nofollow)This is a very important SEO setting. When you check this option, Anqi CMS will automatically add the link to the friend link.rel="nofollow"Property.This means you are telling the search engine not to pass the weight of your website ("link juice") to this link.This is very useful for pointing to some links you do not want to pass weight, or simply for the purpose of cooperation, which helps protect the SEO health of your website.

All added friendship links will be clearly displayed in this list, and you can edit, delete, or adjust the order at any time to ensure the timeliness and accuracy of the friendship link content.It is worth mentioning that Anqi CMS also supports adding and deleting friend links through API, which provides greater flexibility for users with specific automation needs.

Display friendship links: let them shine on the website

Let these carefully selected友情links be displayed on the front end of your website, Anqi CMS provides a simple and powerful template tag——linkList. This tag allows you to call the friend link data in any template file of the website and display it in the style you want.

Generally, friend links appear in the footer area of a website or on a separate "friend links" page. You only need to display the friend links in the template files where they are required (such as the footer filepartial/footer.htmlorindex.htmlInsert a code snippet like this one:

{% linkList friendLinks %}
{% if friendLinks %}
<div class="footer-links">
    <h4>友情链接</h4>
    <ul class="friendship-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 go into a detailed explanation of this code:

  1. {% linkList friendLinks %}This is the start tag of the link list call:friendLinksIs a variable name you define, all the friendship link data obtained will be stored in this variable.
  2. {% if friendLinks %}and{% endif %}: This is a conditional judgment, used to check.friendLinksDoes the variable have data. If there is a link to friendship, the internal code will be executed, otherwise, the area of friendship links will not be displayed to avoid blank pages or errors.
  3. {% for item in friendLinks %}and{% endfor %}This is a loop label, it will iterate overfriendLinksEach friendship link data. In each loop, the current friendship link data will be assigned toitemVariable.
  4. <li><a href="{{item.Link}}" ...>{{item.Title}}</a></li>: This is the specific display code for each friendship link.
    • {{item.Link}}: It will display the link address you set in the background.
    • {{item.Title}}: It will display the link name you set in the background.
    • {% if item.Nofollow == 1 %} rel="nofollow"{% endif %}This line of code will intelligently add or remove the 'Nofollow' option you set in the backgroundrel="nofollow"Property. If the Nofollow option is checked in the background, this property will be output, otherwise it will not.
    • target="_blank"This is an HTML attribute that is usually used for friendship links, indicating that when the link is clicked, it will open in a new window or tab to keep the visitor on your site.

In this way, you can fully control the display style and layout of the friend links, whether it is a simple text link or combined with CSS styling, it can be easily achieved.The AnQi CMS template engine supports Django template engine syntax, giving you great freedom in content display.

Friend link operation tips

  • Regular checks: The validity and quality of the friendship link will change over time.It is recommended to regularly check that all友情链接 are still valid and content is healthy, to avoid dead links or bad links affecting your website's image and SEO.
  • Maintain relevance: Try to exchange friend links with websites related to your website content or industry. This not only helps with SEO, but also provides visitors with more valuable extended reading or services.
  • Use Nofollow Appropriately: For links you do not fully understand or do not want to pass weight to, be sure to check the Nofollow option.For high-quality, mutually beneficial cooperation links, it can be unchecked to allow the normal transmission of weight.

Through AnQi CMS, the management and display of friend links become extremely simple.No matter if you are running a small and medium-sized enterprise website, a personal blog, or an industry portal, AnQi CMS can help you efficiently utilize the important SEO tool of友情链接, bringing more value to your website.


Frequently Asked Questions (FAQ)

Question: What is the specific role of the 'Nofollow' attribute in friendship links? When should I use it?Answer: The Nofollow attribute tells search engines not to pass the 'weight' (also known as 'link juice') of your website to the link.Its main function is to prevent websites from being penalized by search engines for linking to low-quality or irrelevant websites, and it can also prevent the valuable SEO weight from being unintentionally scattered.You should use Nofollow in the following situations: linking to sponsored content, advertisements, user submitted links in comment sections, pointing to external websites you do not fully trust or do not want to endorse, or simply to prevent search engines from tracking the link.

Ask: If my website has many friend links, is it convenient to manage on the Anqi CMS backend?Answer: The Anqi CMS' friend link management interface is designed simply and intuitively, all friend links are displayed in a list, and you can clearly see the link name, address, and Nofollow status.You can edit or delete any link as needed.Although there is no direct grouping feature provided, you can make use of the "link note" field for internal marking and display filtering or classification based on the note content in the frontend template (if there is a second development), thereby achieving more fine-grained management.

Ask: Can I add elements other than text in the friend links, such as images?{{item.Title}}Replace<img src="{{item.Link}}" alt="{{item.Title}}" />This method requires you to manually maintain the image URL, but it provides greater flexibility.