In Anqi CMS, effectively utilizing keywords (Keywords) and tags (Tags) is the key to optimizing content structure, improving search engine visibility (SEO), and enhancing user experience.They not only help websites better organize content, but also guide users to discover more relevant information.接下来,我们将深入探讨如何在文章内容中合理添加这些元素,并确保它们能在网站的详情页或列表页中正确显示。
1. Add keywords in the article content
The keyword is the word that describes the core theme of the article, which is crucial for search engines to understand the content.When publishing or editing articles on the Anqi CMS backend, you will see a field named "Document Keywords".
How to add:
- Manual input:In the 'Document Keywords' input box, you can directly enter words highly relevant to the article content. Please note that multiple keywords should be separated by English commas.
,Perform separation.This separation method not only conforms to the crawling habits of search engines, but also helps the system accurately identify each keyword.For example, an article about 'Anqi CMS tutorial' can be input as 'Anqi CMS tutorial, Content Management System, CMS user guide'. - Select from keyword library:The "Keyword Library ManagementThis is very helpful for maintaining consistency and standardization of keywords.
By carefully selecting and inputting keywords, we provide important clues to the search engine, enabling it to better understand the content of the article and thus increase the chances of the article being displayed when users search for relevant information.
English, in the article content, add Tag tag
Tag labels provide a more flexible way to associate content than categories, allowing articles on specific topics to be connected across different categories and content models, forming an interactive knowledge network.
How to add:
- Add in the article editing page:In the "Add Document" or "Edit DocumentYou can select an existing tag here, or enter a new tag name, then press the Enter key, and the system will recognize it and convert it into a new tag.For example, an article about the new features of the Anqi CMS can be tagged with "New Features
- Label Management:If you need to manage tags more finely, such as modifying the tag name, URL alias, SEO title, or description, you can visit the "Document Tags" management interface in the background.Here you can manage all tags independently, even set up independent templates for tags to achieve more personalized display effects.
The flexible use of tags makes the organization of content more three-dimensional, allowing users to explore more interesting content along the tag线索, which greatly enhances the internal link quality and user stickiness of the website.
Three, associated display keywords on detail page or list page
Keywords are typically used in a website's metadata (Meta Data) to help search engines understand the page topic, rather than displaying it directly to users. In the website template, we can use the Aanqi CMS providedtdkLabel these keywords.
Display keywords on the detail page (usually used in the HTML head section):In most cases, the keywords of the article will be as<meta name="keywords" content="...">The content of the label is displayed in the HTML header of the page, for search engines to crawl. You can call it in your template file (such asdetail.html) in the following way:
<meta name="keywords" content="{% tdk with name="Keywords" %}">
If you want to display keywords directly in the article content area, although it is not common, it can also be done througharchiveDetailtags to retrieve and display:
<div>文章关键词:{% archiveDetail with name="Keywords" %}</div>
Remember that multiple keywords will still be displayed separated by English commas.
Four, Tag tags will be displayed in association on the detail page or list page.
Tag label value lies in its clickability, they are usually displayed as links to guide users to more relevant content. In the Anqi CMS, you cantagListLabel easily achieves this function.
Display related Tag tags on the article detail page:In the article detail page (for example)archive/detail.htmltemplate), we hope to display all the tags belonging to the current article.tagListLabels can help us achieve this, it will automatically identify the document ID of the current page and list the associated tags.
<div>
<strong>相关标签:</strong>
{% tagList tags with itemId=archive.Id limit="10" %}
{% for item in tags %}
<a href="{{item.Link}}" class="tag-item">{{item.Title}}</a>
{% endfor %}
{% endtagList %}
</div>
This code will iterate over all tags of the current article and generate a clickable link for each tag.item.LinkProvide the URL of the tag page.item.TitleThen, the name of the tag is displayed.
Display Tag label on article list page:On article list page (for examplearchive/list.html), if you want to display the associated tags below each article entry, you can nest the tags intagListthe template)archiveListLoop internal:
{% archiveList archives with type="page" limit="10" %}
{% for article in archives %}
<div class="article-item">
<h3><a href="{{article.Link}}">{{article.Title}}</a></h3>
<p>{{article.Description}}</p>
<div class="article-tags">
{% tagList tags with itemId=article.Id limit="5" %} {# 限制显示5个标签 #}
{% for tag in tags %}
<a href="{{tag.Link}}" class="tag-link">{{tag.Title}}</a>
{% endfor %}
{% endtagList %}
</div>
</div>
{% endfor %}
{% endarchiveList %}
Each article can display its unique tags in this way, enriching the information density of the list page.
Create an independent Tag tag list page:To allow users to better browse all tags and view articles under each tag, we can create a separate Tag label list page (usuallytag/index.htmlortag/list.htmlTemplate). Here, you can usetagDataListtags to get the list of articles under a specific tag, and combinepaginationtags for pagination.
For example, intag/list.htmlthe template:
{% tagDetail currentTag with name="Title" %} {# 获取当前标签的标题 #}
<h2>{{currentTag}} 下的文章</h2>
{% tagDataList archives with type="page" limit="10" %}
{% for item in archives %}
<div class="tagged-article">
<h3><a href="{{item.Link}}">{{item.Title}}</a></h3>
<p>{{item.Description}}</p>
<span>发布日期:{{stampToDate(item.CreatedTime, "2006-01-02")}}</span>
</div>
{% endfor %}
{% endtagDataList %}
<div class="pagination-area">
{% pagination pages with show="5" %}
{# 你的分页HTML代码 #}
{% if pages.PrevPage %}<a href="{{pages.PrevPage.Link}}">上一页</a>{% endif %}
{% for item in pages.Pages %}<a class="{% if item.IsCurrent %}active{% endif %}" href="{{item.Link}}">{{item.Name}}</a>{% endfor %}
{% if pages.NextPage %}<a href="{{pages.NextPage.Link}}">下一页</a>{% endif %}
{% endpagination %}
</div>
This design not only makes it easier for users to find relevant content, but also provides a clear site structure for search engines, which is beneficial for SEO.
V. SEO Optimization and User Experience
Make full use of keywords and Tag tags, which can significantly improve the SEO performance and user experience of the website.Keyword helps the search engine understand the content theme of your content, while Tag tags create a rich internal link structure, which helps to enhance the page weight transmission.tag-{id}(-{page})The format Tag URL), ensures that these tag pages have search engine-friendly URLs.
By following the above steps, we not only enriched the information of the article at the content level, but also utilized the powerful functions of Anqi CMS in terms of technology to ensure that keywords and Tag tags can be effectively managed and displayed, thereby bringing better traffic and user interaction to the website.
Common Questions (FAQ)
What is the difference between keywords and Tag tags? How should I choose to use them?关键词(Keywords)主要用于描述文章的核心内容,更多是提供给搜索引擎作为页面元数据(meta keywords)使用,帮助搜索引擎理解页面主题。Although some CMS may display on the frontend, their main function is SEO.And Tag tag (Tags) is a more flexible content organization method, which is used to link all articles discussing the same topic on a website, forming a navigable network.Tag label is usually presented as a clickable link on the page, allowing users to browse and discover more related content, emphasizing user experience and internal links.When selecting, the keyword should accurately summarize the content, while Tag labels can be more general or multi-dimensional to describe the content theme, promoting content discovery.
Why is my article not displayed on the front end even though I have added Tag tags?This situation usually has several reasons:
- Template not called:Your website template (especially the article detail page or list page template) may not be using
tagListCall and display Tag information using the tags provided by Auto CMS. You need to edit the corresponding template file and add a code snippet similar to the one provided in the article.tagList代码片段。 - Cache issue:Even if the template has been modified, the website's cache mechanism may cause the changes to not be displayed immediately. Try clearing the system cache of the Anqii CMS backend or refreshing your browser cache.
- CSS style hiding:Tags may already be displayed on the page, but due to CSS style settings (such as
display: none;The content has been hidden. You can check the HTML structure of the page through the browser's developer tools to confirm the existence of the tag.
- Template not called:Your website template (especially the article detail page or list page template) may not be using
How can the Tag tag page have better SEO performance?To optimize the Tag tag page's SEO, you can start from the following aspects:
- Friendly URL structure:Ensure that the URL of the Tag tab page is static and meaningful, for example
yourdomain.com/tag/seo-optimization.html. Anqi CMS usually handles this through static rules automatically. - Improve the tag details:In the background “Document Tag” management, set unique “SEO Title”, “Tag Keywords”, and “Tag Description” for each tag. This information will be used on the tag page.
<title>/<meta name="keywords">and<meta name="description">Label, enhance the search engine's understanding of the tab. - High-quality label content:Ensure that there are enough associated articles under each label and that the content quality is high.Avoid creating "empty tab pages" with only one or two articles, as this will be considered low-quality content by search engines.
- Provide label description:If the Tag tag page is allowed, a brief, original text description can be added to the top of the page, explaining the theme covered by the tag, and increasing the richness of the page content.
- Internal and external links:Ensure that the Tag tag page can be effectively linked by other pages (internal links), and if possible, strive for some high-quality external links.
- Friendly URL structure:Ensure that the URL of the Tag tab page is static and meaningful, for example