As a website operator who deeply understands the operation of AnQiCMS, I know the value of friend links to a website.They are not just simple external links, but also an important means to improve website authority, introduce high-quality traffic, and enhance user trust.By carefully managing and reasonably arranging the友情链接, we can effectively optimize the website's search engine performance and provide visitors with more valuable extended information.

This article will detail how to set up friend links in AnQiCMS and display them correctly in your website template.

Set up friend links in the AnQiCMS backend

Managing friend links in AnQiCMS is an intuitive and efficient process.Firstly, you need to log in to your AnQiCMS admin interface.Once you enter the background, you will see the function menu on the left, which includes the entry points for all the functions of the website.

Please find and click on the item 'Function Management'.In the "Feature ManagementClick it to enter the management page of the友情链接 links.

On this page, you can perform all operations related to the friend links. When you need to add a new friend link, the system will provide the corresponding form for you to fill in the various information of the link, usually including:

  • Link nameThis is the name displayed on your website for the friendship link, which is usually the name or brand word of the other website.
  • Link AddressThis is the complete URL of the other website, ensure it is correct and accurate so that users can access it smoothly.
  • Link NoteYou can add some internal notes to the link for easy management and identification. These notes are usually not displayed on the front end.
  • Is NofollowThis is an important SEO option. If this option is checked, the system will add to the HTML code of the friend links.rel="nofollow"Property. This tells the search engine that the link should not pass the weight of your website, usually used to avoid passing weight to external websites that are not fully trusted, or to comply with search engine guidelines.

In addition to adding links, you can also edit the information of existing links on this page, or delete those that are no longer needed or have expired.AnQiCMS provides a clear interface, ensuring that you can easily maintain these external resources.According to the update log, AnQiCMS v2.1.1 version also adds API interfaces to support the addition and deletion of friend links, which provides more flexibility for users with customized needs.

Display friend links correctly in the website template

The backend settings of the友情链接 are completed, and the next step is to display them on your website's front page.AnQiCMS through its powerful template tag system makes it very easy to call data in templates.linkListUse tags to obtain and display friend links.

First, open the file in your website template that needs to display the friend links, which is usually the footer file, or a specific area on the homepage, or even a dedicated friend links page.

You can use{% linkList 变量名称 %}Such a structure is used to call the friend link data. For example, you can name the variablefriendLinks.

{% linkList friendLinks %}
    {% if friendLinks %}
    <div class="footer-links-section">
        <h3>友情链接</h3>
        <ul class="friendship-links-list">
            {% for item in friendLinks %}
            <li>
                <a href="{{item.Link}}" {% if item.Nofollow == 1 %} rel="nofollow"{% endif %} target="_blank" title="{{item.Remark}}">
                    {{item.Title}}
                </a>
            </li>
            {% endfor %}
        </ul>
    </div>
    {% endif %}
{% endlinkList %}

In the above code snippet:

  • {% linkList friendLinks %}The statement tells AnQiCMS to get all the friend links and store them in a variable namedfriendLinks.
  • {% if friendLinks %}Is a conditional judgment, ensuring that the entire block is rendered only when there is friendship link data, to avoid empty titles or empty lists on the page.
  • {% for item in friendLinks %}to iteratefriendLinksEach item in the array. Inside the loop,.itemRepresents the current friendship link object.
  • {{item.Link}}Used to output the URL address of the friendship link.
  • {{item.Title}}Used to output the display name of the friendship link.
  • {% if item.Nofollow == 1 %} rel="nofollow"{% endif %}Check if this link is marked asnofollowin the background<a>tag.rel="nofollow"properties.
  • target="_blank"The property is usually used to make links open in a new window or tab to preserve the user's current browsing session on your website.
  • title="{{item.Remark}}"The remarks set in the background can be used as the link'stitleProperties, it will display a remark when hovering over the mouse, which helps improve user experience.

Through this simple template code, you can dynamically display the友情链接(friendship links) that are configured on the back-end on your website front-end.Please note that to maintain the cleanliness and good user experience of the website, it is recommended to add appropriate CSS styles to the友情链接 (friend links), so that they are consistent with the overall design style of the website.In addition, regularly checking the validity of the友情链接 links and deleting the invalid links is an important part of maintaining a healthy website.

Common questions about友情链接

问:What is the role of the “Nofollow” attribute in the link?rel="nofollow".This means that when the search engine crawls the website, it usually does not use this link as a basis for passing weight, which helps inform the search engine that this link is not an认可vote for your website.This is usually used to avoid passing weight to external websites that are not fully trusted, or to comply with specific guidelines of search engines.

问:How to manage friend links in AnQiCMS background? 答:You can log in to the AnQiCMS backend management interface, then navigate to the "Function Management" section, where you can find and click the "Friend Links" option.After entering, you can conveniently add new friendship links, edit the names, URLs, notes of existing links, and also set the Nofollow attribute, as well as delete links that are no longer needed.

问:友情链接应该放置在网站的什么位置比较合适? 答:Friendship links are usually placed at the bottom (footer) area of a website, or on a dedicated "Friendship Links" page.This is convenient for users to find and does not interfere with the reading experience of the main content of the website.Based on the design style of the website and your SEO strategy, you can also display it moderately in the sidebar or other unobtrusive but easily accessible positions.