As an experienced website operations expert, I know that friendship links and website comments are crucial for the long-term development of a website and user interaction.AnQiCMS as an efficient enterprise-level content management system provides powerful and flexible functional support in these aspects, allowing operators to easily handle it and transform it into a valuable asset of the website.Today, let's delve into how to efficiently manage these interactive elements in the AnQiCMS backend.
Insight into AnQiCMS: Make good use of friendship links and website comments to empower website interaction and SEO
Next, we will gradually learn how to manage the friendship links and website comments in the AnQiCMS background, and discuss some practical operation strategies.
【en】One, carefully layout, efficient management of友情链接
Friendship links are cooperative relationships between websites that benefit each other, acting like "recommendation letters" that inform search engines and users about which high-quality sites your website is connected with.In AnQiCMS, managing friend links is extremely simple.
【en】1. Backend operations, easily control:【en】You can find in the AnQiCMS backend“Function Management”【en】module【en】“Friend Link Management”Entry. Click to enter and you will see a clear list displaying all added friendship links.
- Add a new link:If you want to add a new friend link, just click the 'Add' button, fill in the 'Name', 'URL address', 'Note' in the form that pops up, and check whether the 'Nofollow' attribute is selected.The 'Nofollow' attribute is particularly crucial, as it instructs search engines not to follow this link and pass on weight. Checking 'Nofollow' is a wise SEO choice for links that are not fully trusted or purely for exchanging traffic.
- Edit and delete:For existing links, you can edit them at any time, modify their information or Nofollow status.Of course, it can also be easily deleted if a link is no longer active or does not meet your cooperation standards.
2. Template invocation, flexible display:The friend link is supposed to be displayed on the front page to users and search engines.AnQiCMS allows you to highly customize the display style of friendship links through concise template tags.footer.htmlor a dedicated "Friend Links" page), you can uselinkListtags to call these links:
{% linkList friendLinks %}
{% if friendLinks %}
<div class="footer-links">
<h4>友情链接</h4>
<ul>
{% 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 %}
In this code,friendLinksthe variable will carry all the data of the friend links, byforlooping through each oneitem.item.LinkPoint to the link address,item.TitleDisplay the link name,item.Nofollow == 1which will automatically add properties according to the backend settings,rel="nofollow"making it very convenient for operators to have refined control over SEO.
Two, Create community, manage website comments efficiently
Website comments are the most direct bridge of interaction between users and website content. They can help you understand user needs, enhance the value of the content, and inject endless fresh vitality into the website.AnQiCMS provides a comprehensive comment management function.
1. Backend review, purify content:The core of website comment management lies in content review to ensure the health and order of the community environment. In the AnQiCMS backend, you can go through“Function Management”module.Content Comment ManagementProcess all user comments.
- Centralized management:Here will be listed all submitted comments, including pending, approved, and rejected comments. You can easily filter and view them by article, time, or status.
- Moderation action:Each comment has operation buttons such as "Review", "Reply", and "Delete".For newly submitted comments, you can first read their content, then choose 'Approve' to display them on the front page, or 'Reject' to hide them.You can also reply directly to user comments here, interacting with the user.
- Rubbish Comment Protection:To deal with the challenge of spam comments, AnQiCMS also supports enabling the captcha feature.You can enable comment captcha in the "Global Settings" -> "Content Settings" on the backend to effectively prevent malicious flooding by automated tools.After enabling, the captcha field needs to be integrated when submitting comments on the front end. The system ensures that only comments passing the captcha verification can be submitted.
2. Template Display, Spark Interaction:AnQiCMS provides to display comments on the front-end page:commentListTags. This is usually applied to article detail pages or product detail pages.
<div class="comments-section">
<h4>用户评论</h4>
{% commentList comments with archiveId=archive.Id type="page" limit="10" %}
{% for item in comments %}
{% if item.Status == 1 %} {# 只显示已审核通过的评论 #}
<div class="comment-item">
<p class="comment-meta"><strong>{{item.UserName}}</strong> 于 {{stampToDate(item.CreatedTime, "2006-01-02 15:04")}} 评论道:</p>
{% if item.Parent %} {# 如果是回复,显示引用内容 #}
<blockquote class="comment-quote">
{{item.Parent.Content|truncatechars:80}}...
</blockquote>
{% endif %}
<p class="comment-content">{{item.Content|safe}}</p>
<div class="comment-actions">
<a href="javascript:;" class="reply-btn" data-id="{{item.Id}}" data-user="{{item.UserName}}">回复</a>
<a href="javascript:;" class="praise-btn" data-id="{{item.Id}}">赞 ({{item.VoteCount}})</a>
</div>
</div>
{% endif %}
{% else %}
<p>目前还没有评论,快来发表您的看法吧!</p>
{% endfor %}
{% endcommentList %}
{# 评论提交表单 #}
<form method="post" action="/comment/publish" class="comment-form">
<input type="hidden" name="archive_id" value="{% archiveDetail with name="Id" %}">
<input type="hidden" name="parent_id" id="parent_id" value="">
<input type="hidden" name="return" value="html"> {# 假设你希望服务器返回HTML片段 #}
<p><label for="user_name">您的昵称:</label><input type="text" id="user_name" name="user_name" required></p>
<p><label for="comment_content">评论内容:</label><textarea id="comment_content" name="content" rows="5" required></textarea></p>
{# 验证码区域,如果开启了验证码功能 #}
<div class="captcha-area">
<input type="hidden" name="captcha_id" id="captcha_id">
<input type="text" name="captcha" required placeholder="请输入验证码" class="captcha-input">
<img src="" id="get-captcha" class="captcha-img" alt="验证码">
<script>
document.getElementById('get-captcha').addEventListener("click", function (e) {
fetch('/api/captcha')
.then(response => response.json())
.then(res => {
document.getElementById('captcha_id').setAttribute("value", res.data.captcha_id);
document.getElementById('get-captcha').setAttribute("src", res.data.captcha);
}).catch(err => console.error('获取验证码失败:', err));
});
document.getElementById('get-captcha').click();
</script>
</div>
<p><button type="submit">提交评论</button></p>
</form>
</div>
In this piece of code,archiveId=archive.IdMake sure the comments are associated with the current article;type="page"Means supporting pagination display;item.Status == 1Used to display only reviewed comments. The comment submission form passes.action="/comment/publish"Submit data to the background, supported.parent_idImplement the reply function and integrate the captcha calling logic, making the comment feature both perfect and secure. In addition, it also showcases the comment like function.item.VoteCountFurther enriches the interactive dimension.
Three, Operation Strategy and Practical Suggestions
- Friendship Link Strategy:
- Regular Inspection:Friendship links need to be regularly checked for their validity and relevance, and dead links should be removed