How to add keywords and Tag tags in article content and display them associated in detail pages or list pages?

Calendar 👁️ 75

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.Next, we will delve into how to reasonably add these elements to the article content and ensure that they can be displayed correctly on the website's detail page or list page.

1. Add keywords in the article content

Keywords are words that describe the core theme of the article and are crucial for search engines to understand the content.When you publish or edit articles in the Anqi CMS backend, you will see a field named "Document Keywords".

How to add:

  1. Manual input:In the 'Document Keywords' box, you can directly type in 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 search engine's crawling habits, but also helps the system accurately identify each keyword.For example, an article about "AnQi CMS tutorial" can be entered as
  2. Select from keyword library:The AnQi CMS provides the 'Keyword Library Management' feature, you can also add appropriate words to the article by clicking the 'Select Keyword' button from the preset keyword library.This is very helpful for maintaining consistency and standardization of keywords.

By carefully selecting and inputting keywords, we provide important clues to search engines, enabling them to better understand the content of the article, thereby increasing the chance that the article will be displayed when users search for related information.

Second, add Tag tag to the article content

Tags provide a more flexible way to associate content than categories, allowing articles discussing specific topics to be connected across different categories and content models, forming an interactive knowledge network.

How to add:

  1. Add on the article editing page:In the 'Add Document' or 'Edit Document' interface, you will find the 'Tag' field.You can select an existing tag here, or enter a new tag name, then press Enter, and the system will recognize and convert it into a new tag.For example, in addition to being categorized as "Product Introduction", an article about the new features of AnQi CMS can be tagged with "New Features", "System Update", "Go Language Development", and so on.
  2. Tag Management:If you need to manage tags more precisely, such as changing the name, URL alias, SEO title, or description, you can visit the background "Document Tag" management interface.Here you can independently manage all tags, and 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线索, greatly enhancing the internal link quality and user stickiness of the website.

Three, display keywords in 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 directly displaying it to users. In the website template, we can use the Anqicms providedtdkTag to call 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 used as<meta name="keywords" content="...">The tag content appears in the HTML header of the page, for search engines to crawl. In your template file (such asdetail.html), you can use the following method to call it:

<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 througharchiveDetailtag to retrieve and display:

<div>文章关键词:{% archiveDetail with name="Keywords" %}</div>

Remember that multiple keywords will still be displayed separated by English commas.

Tag tags are displayed in detail pages or list pages.

The value of a tag lies in its clickability, which is usually displayed as a link to guide users to more relevant content. In AnQi CMS, you can access it bytagListThe tag easily realizes this function.

Display related Tag tags on the article detail page:In the article detail page (for examplearchive/detail.htmlTemplate), we hope to display all the tags of the current article.tagListTags 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 traverse all the tags of the current article and generate clickable links for each tag.item.LinkProvide the URL of the tag page,item.TitleIt displays the name of the tag.

Display the Tag tags on the article list page:In the article list page (for examplearchive/list.htmlTemplate), if you want to display the associated tags below each article entry, you can usetagListNested in a tagarchiveListLoop inside:

{% 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 %}

In this way, every article can display its unique tags, enriching the information density of the list page.

Create an independent Tag tag list page:To allow users to browse all tags and view articles under each tag, we can create a separate Tag tag list page (usuallytag/index.htmlortag/list.htmlTemplate). Here, you can usetagDataListtags to get a list of articles under a specific tag and combinepaginationTagging implements pagination.

For example, intag/list.htmlin the 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

Fully utilizing keywords and Tag tags can significantly improve the SEO performance and user experience of the website.Keywords help search engines understand the theme of your content, and Tag tags create rich internal link structures, which help to enhance page authority transmission.The pseudo-static URL feature of AnQi CMS (for exampletag-{id}(-{page})Formatted Tag URL, ensuring that these tag pages have SEO-friendly URL addresses.

By following these steps, we not only enriched the information of the article at the content level, but also utilized the powerful functions of Anqicms on the technical level, ensuring that keywords and Tag tags can be effectively managed and displayed, thereby bringing better traffic and user interaction to the website.


Frequently Asked Questions (FAQ)

  1. What is the difference between keywords and Tag tags? How should I choose to use them?Keywords are mainly used to describe the core content of an article, more often provided to search engines as page metadata (meta keywords) to help search engines understand the theme of the page.Although some CMS may display on the front end of the page, its main function is SEO.And Tag tags (Tags) is a more flexible way to organize content, used to associate all articles discussing the same topic on the site, forming a navigable network.Tags are usually presented as clickable links 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 multidimensional to describe the content theme, promoting content discovery.

  2. Why did my article not display on the front end after adding Tag tags?There are usually several reasons for this situation:

    • The template has not been called:Your website template (especially the article detail page or list page template) may not be usingtagListUse the tags provided by Anqie CMS to call and display Tag information. You need to edit the corresponding template file and add code snippets similar to those provided in the article.tagListCode snippet.
    • Cache problem:Even if the template has been modified, the caching mechanism of the website may cause the changes not to be displayed immediately. Please try to clear the system cache of the Anqi CMS backend, or refresh your browser cache.
    • CSS style hiding:The tag may already be displayed on the page, but due to CSS style settings (such as display: none;It was hidden. You can check the page HTML structure through the browser's developer tools to confirm that the tag exists.
  3. How to make the Tag label page have better SEO performance?To optimize the SEO of the Tag label page, you can start with the following aspects:

    • Friendly URL structure:Ensure that the URL of the Tag tag page is static and meaningful, for exampleyourdomain.com/tag/seo-optimization.htmlThe AnQi CMS usually handles this through the static rule automatically.
    • Improve the tag details:In the "Document Tag" management in the background, set a 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">Tag, enhance the understanding of search engines for tabs.
    • High-quality tag content:Ensure that the number of articles associated with each tag is sufficient and the content quality is high.Avoid creating a 'blank tab page' with only one or two articles, as it will be considered low-quality content by search engines.
    • Provide tag description:If the Tag label page allows, you can add a brief, original text description at the top of the page, explaining the theme covered by the label to enrich the page content.
    • Internal and external links:Ensure that the Tag label page can be effectively linked from other pages (internal links), and if possible, strive for some high-quality external links.

Related articles

How to use the AnQiCMS timing publishing function to control the display time of content and achieve automated operation?

In the daily work of content operation, maintaining the continuous update and scheduled release of website content is a key factor in attracting users and enhancing brand influence.However, manually publishing content is not only time-consuming, but also limited by the time and energy of operation personnel, especially when it is necessary to target global users, cross-time zones, or carry out a series of content promotions, the challenges are even greater.AnQiCMS (AnQi CMS) precisely understands these pain points, cleverly integrates the powerful timing publishing function, helps you achieve automated content operation, and keep your website always vibrant.

2025-11-08

How to call and categorize the recommended attributes (such as headlines, sliders) of AnQiCMS articles on the frontend?

How to make important and excellent content stand out and attract users' attention at the first time is the key to improving user experience and content marketing effectiveness in website operation.AnQiCMS provides a very practical recommendation attribute mechanism, which helps us easily classify and highlight content, such as setting hot articles as 'Headlines' or displaying selected products in the 'Slider' area.

2025-11-08

How to set up independent templates for specific articles, categories, or single pages to achieve customized content display?

In website operation, we always encounter some unique content, which may represent a special promotional event, an important corporate report, or a page that needs to be presented specially.This content often does not meet the unified default style of the website, and needs its own 'face' to attract users and highlight the key points.AnQiCMS (AnQiCMS) fully understands this need, therefore it provides a very flexible template customization feature, allowing us to easily set up independent templates for specific articles, categories, or single pages, achieving customized content display.Why do we need an independent template

2025-11-08

How to correctly reference and display variables in AnQiCMS templates and make conditional judgments to control content display?

In AnQiCMS templates, flexibly referencing variables and using conditional judgments to control content display is the key to building dynamic and feature-rich websites.AnQiCMS uses a template engine syntax similar to Django, making template development both intuitive and powerful.This article will delve into how to effectively manage variables and logic in the AnQiCMS template, helping you better control the presentation of content.--- ## One, AnQiCMS template basics: variable reference and display In AnQiCMS template

2025-11-08

How does AnQiCMS handle the SEO title, standard link, and permanent link of articles, affecting their display in search engines?

In website operation, Search Engine Optimization (SEO) has always been a key link in obtaining natural traffic.How a content management system (CMS) effectively handles the SEO title, link structure, and URL normalization directly determines the visibility and performance of your content in search engines.AnQiCMS (AnQiCMS) is a system focused on enterprise-level content management, providing flexible and powerful tools in these aspects to help us better optimize website content.### Accurately Control Search Results

2025-11-08

How to set a thumbnail for an article and control its display size and method on different list pages or detail pages?

In website content operation, article thumbnails play a vital role.It is not only the 'face' of the article content, attracting visitors to click, but also effectively improves the overall beauty and user experience of the page.AnQiCMS provides a comprehensive and flexible set of features, helping us easily set thumbnails for articles and finely control their display size and method according to different scenarios. ### One, set the thumbnail for the article Adding a thumbnail to the article is an important part of the content publishing process.

2025-11-08

How does AnQiCMS ensure the correct rendering and display of article content (including Markdown, mathematical formulas, flowcharts) on the front-end?

In today's era of increasingly rich and diverse content creation, we often need to present on websites not only plain text, but also a variety of Markdown documents, complex mathematical formulas, and intuitive flowcharts.As website operators, the most concerning issues for us are whether the input of these contents is convenient, and whether they can be correctly and beautifully rendered and displayed on the front end.AnQiCMS (AnQiCMS) provides a highly efficient and flexible solution in this regard.###

2025-11-08

How to customize SEO title, keywords, description, and URL display on the category page to optimize the performance of the category page?

In website operation, category pages play a vital role, they are not only the key entry points for users to browse content and explore the website structure, but also the core nodes for search engines to understand the website theme and allocate weight.Effectively optimize the SEO performance of the category page, which can significantly improve the overall visibility and user experience of the website.AnQiCMS (AnQiCMS) provides powerful and flexible tools for users, allowing for detailed customization and optimization of SEO titles, keywords, descriptions, and URL structures on category pages.

2025-11-08