In website operation, friend links play an indispensable role.They not only help improve the search engine ranking (SEO) of the website, but also bring potential visitor traffic and enhance the user experience, allowing visitors to get more information through related websites.AnQiCMS (AnQiCMS) knows this well, therefore it provides an intuitive and convenient friend link management function, allowing you to easily add, manage, and display these important external connections.
This article will thoroughly introduce how to add friend links in the Anqi CMS backend, as well as how to flexibly display them in the website's frontend template, helping your website better integrate into the internet ecosystem and realize greater value.
一、Security CMS backend adds friend links
Let's start from the website backend and add the new friend link to your management scope.
Enter the friend link management interfaceLog in to your security CMS backend.Find and click on the item 'Function Management' in the left navigation menu.In the expanded submenu, you will see the option 'Friend Links', click on it to enter the Friend Links list page.
Add a new friend linkAt the top or in a prominent position of the friendship link list page, there is usually a "Add Friendship Link" button. Clicking this button will pop up a form for you to fill in the detailed information of the new link:
- Link Name (Title):This is the text displayed to visitors on your website for the friendship link, which is usually the name or brand word of the other website.
- Link Address (Link):Enter the complete URL address of the other website, be sure to include
http://orhttps://Prefix, and ensure the address is accurate and error-free to avoid link failure. - RemarkThis is an optional field. You can add internal notes to this link, such as the contact person of the counterparty website, cooperation date, etc. This information will not be displayed on the website frontend and is only for background management use.
- Nofollow Attribute (Nofollow)
EnglishThis is a very important SEO option.This option means that you tell the search engine 'Do not track this link' or 'Do not pass my website authority to this link'.
Nofollow,to better control the SEO weight flow of your website. For high-quality, mutually beneficial partner links, you can leave it unchecked to allow the weight to pass normally.
After filling in, click the "OK" or "Save" button, your new friendship link will be successfully added to the background management list.
Manage existing friendship linksOn the link list page, you can perform various operations on the links that have been added.For example, you can edit the name, address, or Nofollow attribute of the link; you can delete links that are no longer cooperative or invalid; usually, the system will also provide sorting functions, allowing you to adjust the display order of friend links according to importance or cooperative relationships.Regularly check and maintain the quality of friendship links is an important part of maintaining a good SEO performance of the website.
二、English CMS前台模板中显示友情链接
Added friendship links in the background, and then you need to display them on the front page of your website.The CMS provides powerful template tag functions, making this process very flexible and efficient.
Choose the appropriate template fileFriendship links are usually placed in the footer, sidebar, or a dedicated "friendship links" page of a website.You need to find the corresponding template file to edit according to the design and requirements of the website.
partial/footer.htmlorbash.html(如果页脚是公共部分且通过)include引入)。Use
linkListTag retrieve friendship link dataEnglish CMS内置了linkListLabel, used specifically to retrieve all added friendship link data. Its basic usage is very concise:{% linkList friendLinks %} {# 在这里处理友情链接数据 #} {% endlinkList %}In this example,
friendLinksThis is a variable name that you have customized for the friend link list data you have obtained, you can name it according to your own habits.Loop through and display the friend links
friendLinksA variable is an array object containing all the friendship link information. You need to go through it with aforloop to iterate through each link one by one, and display their names, addresses, and other information.Each friendship link item (we usually name it in the loop)
itemcontains the following available fields:item.Title: Link name.item.Link: Link address.item.Remark:Link remark (for backend use only, usually not displayed on the frontend).item.Nofollow:Nofollow attribute, its value is1Indicates that Nofollow is checked, for0Representing unchecked.
Combining these fields, you can build the HTML structure for the friend link. Here is a commonly used example code that can be directly copied to your template file:
{% linkList friendLinks %} {% if friendLinks %} <div class="footer-links"> <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.Title}}"> {{item.Title}} </a> </li> {% endfor %} </ul> </div> {% endif %} {% endlinkList %}This code first checks
friendLinksif the list is empty to avoid displaying an empty title and list when there are no friendship links. Then, it loops through each link to create aforone for each link.<a>Label. Note{% if item.Nofollow == 1 %} rel="nofollow"{% endif %}This code, it will dynamically add attributes to the link based on the settings of the backgroundrel="nofollow"At the same time,target="_blank"The property ensures that links open in a new window or new tab, enhancing the user's browsing experience.title="{{item.Title}}"The link name can be displayed when the mouse hovers over it, increasing readability.Save and update cachePlease save your changes after modifying the template file.To ensure that the website's front-end can display the latest content in time, you may need to click the 'Update Cache' feature in the Anqi CMS background and clear the system cache.After that, refresh your website page, and you will see the newly added and displayed link.
By following these steps, you can efficiently manage and display友情链接 in the Anqi CMS, not only optimizing the website's SEO performance, but also providing more valuable external resources to visitors.The design philosophy of AnQi CMS is to make content management simple and powerful, and the friendly link feature is a manifestation of this philosophy.
Common Questions (FAQ)
1. Does SafeCMS support image links as friend links? How should one operate if they need an image link?The "Friend Links" feature built into "AnQi CMS" is primarily designed for text links, and currently its template tags arelinkListThe provided fields do not contain image addresses. If your website specifically needs to display friendship links with thumbnails or logos, you can consider the following two methods to implement:
- Create a custom content model:Using the "Flexible Content ModelIn this model, you can customize fields such as 'Link Name', 'Link Address', and 'Link Image (Logo/Thumb)'.
archiveListCoordinate with specificmoduleId) to call and display these image links. - Use 'single page' combined with manually written HTML:If the number of image links is not many, you can create a special 'Friend Links' single page in the 'Page Management'.In the content editor on this page, you can directly manually insert HTML link code with images.
2. What is the specific function of the Nofollow attribute in the友情链接? When should it be used?
rel="nofollow"It is an HTML attribute that tells search engine crawlers not to follow the link and not to pass any "link equity" (Link Equity) from your website to the linked website. Its main function is:
- Control SEO weight loss:When you link to a low-quality, untrusted, or website that is not entirely relevant to your content, using Nofollow can prevent your website's authority from being diluted or passed to inappropriate websites.
- Adhere to the search engine guidelines:For links in paid links, advertisement links, or content generated by users in comment sections, forums, etc., search engines usually require the use of Nofollow to prevent manipulation of search rankings.
- When to use:Suggest using the Nofollow attribute for advertising links, sponsored content, user-posted uncontrolled links, and external links whose content quality or relevance to your website theme you are unsure of. For partner links that have been strictly selected, have high-quality content, are mutually beneficial with your website, and can provide value to users, it is usually unnecessary to add Nofollow.