How to display the document Tag label on the front-end page and use it as an entry for content association?

Calendar 👁️ 85

How to effectively organize and present content in modern website operations is not only related to user experience, but also a key factor in Search Engine Optimization (SEO).AnQiCMS provides a powerful and flexible Tag feature that can not only help you better manage website content but also act as a convenient entry point for users to discover related information, greatly enhancing the connectivity and interactivity of content on the website.

Overview of Tag labels in Anqi CMS

In Anqi CMS, the design concept of Tag label is very open and flexible.They are different from the traditional classification system, not limited to specific content models or classification levels, and can be freely used across various content types such as articles, products, etc.You can understand Tag as a keyword of the topic of the content, which can effectively link documents with similar or related themes scattered in different categories.For example, an article about "website design trends" and a "responsive website building product", although belonging to different models, can still share the "responsive design" tag, thus establishing a horizontal connection between content.

Background management and content association: lay a foundation for front-end display

In order to effectively display and utilize Tag tags on the front-end page, it is necessary to first do a good job of background settings and content association.

When you edit or publish documents, Anqie CMS provides a convenient Tag label input box.You can directly enter a new tag, press Enter to create and associate;You can also select from the existing tag library. This operation allows content creators to easily add multiple relevant keywords to each document.

Further, Anqi CMS allows you to set independent "tag name", "index letter", "custom URL", "SEO title", "tag keywords", and "tag description" for each tag in the Tag label management interface (document tag).These settings are crucial for improving the search engine friendliness of the Tag page.Especially the "Custom URL" feature, which helps you create clear and meaningful static URLs, which is very beneficial for SEO inclusion and user memory.By configuring special SEO information for Tag tags, you can ensure that each Tag page performs better in search engines.

Front-end page display: Make the Tag label come to life

After the Tag label is associated with the content in the background and configured, the next step is how to cleverly display them on the front-end page and transform them into an entry point for users to explore the content.AnQi CMS provides dedicated template tags to make this process simple and intuitive.

Display related Tags on the document detail page

On the article or product detail page, displaying the associated Tag label is the most direct way to link the content.This can help readers quickly understand the multiple dimensions of the current content and guide them to explore more related content.

You can usetagListLabel to get the current document associated Tag list. You can call it like this in the document detail page template.

<div>
    <strong>相关话题:</strong>
    {% tagList tags with itemId=archive.Id limit="10" %} {# 获取当前文档的最多10个Tag #}
    {% for item in tags %}
    <a href="{{item.Link}}" class="tag-link">{{item.Title}}</a> {# 每个Tag都是一个可点击的链接 #}
    {% endfor %}
    {% endtagList %}
</div>

This code will traverse the current document(archive.IdAssociate all Tags and generate a series of clickable links.Users click on these links and can be redirected to the exclusive page of the Tag to view all documents associated with the Tag.

Create Tag tag list page: Explore all topics

To allow users to view all the popular topics or keywords on the website, you can create a dedicated 'Tag tag list page'. Usually, this page corresponds to the template directory under your.tag/index.htmlfile.

You can use this page totagListTags to display all the Tags on the website, and can combine the pagination feature to make the list easier to browse:

<div class="tag-cloud">
    <h2>热门标签</h2>
    {% tagList tags with type="page" limit="50" %} {# type="page"启用分页,limit设置每页显示数量 #}
    {% for item in tags %}
    <a href="{{item.Link}}" title="共{{ item.ArchiveCount }}篇文章">{{item.Title}} ({{item.ArchiveCount}})</a>
    {% endfor %}
    {% endtagList %}

    {# 如果标签数量多,可能需要分页 #}
    <div class="pagination">
        {% pagination pages with show="5" %}
        {# 这里可以放置分页链接的代码,参考pagination标签用法 #}
        {% endpagination %}
    </div>
</div>

This code will list all the Tags on the website and display the number of documents associated with each Tag(ArchiveCount)。Users can find all topics on this page and delve deeper into their interests according to their interests.

Create a document list page under the Tag tag: Focus on a specific topic

When a user clicks on a Tag link, they expect to see all documents associated with that Tag. This page usually corresponds to your template directory undertag/list.htmlfile.

Here, you need to usetagDataListTag to retrieve the document list associated with the current Tag. This tag will automatically read the Tag ID of the current page (if included in the URL) and retrieve all related articles or products.

<div class="tag-documents">
    {% tagDetail currentTag with name="Title" %} {# 获取当前Tag的标题 #}
    <h2>标签:{{ currentTag }}</h2>

    {% tagDataList archives with type="page" limit="10" %} {# 获取与当前Tag关联的文档列表,并启用分页 #}
    {% for item in archives %}
    <article>
        <h3><a href="{{item.Link}}">{{item.Title}}</a></h3>
        <p>{{item.Description}}</p>
        <p class="meta">发布于:{{stampToDate(item.CreatedTime, "2006-01-02")}} | 阅读:{{item.Views}}</p>
    </article>
    {% endfor %}
    {% empty %}
    <p>当前标签下没有找到任何文档。</p>
    {% endtagDataList %}

    {# 文档列表的分页导航 #}
    <div class="pagination">
        {% pagination pages with show="5" %}
        {# 这里放置分页链接的代码 #}
        {% endpagination %}
    </div>
</div>

This code first displays the current Tag's title, then lists all documents associated with the Tag, and provides pagination features.So, users can easily browse all content under a specific topic.

Tag detail page information display

In addition to the document list, the Tag itself can also have a detail page to display its own description information, which is very valuable in terms of SEO and user understanding. For example, you cantag/list.htmlPage adds Tag description and Logo.

You can usetagDetailTag to get the details of the current Tag:

<div class="tag-info">
    {% tagDetail tagInfo with name="Title" %}
    <h1>{{ tagInfo }}</h1>
    {% tagDetail tagDesc with name="Description" %}
    {% if tagDesc %}
        <p>{{ tagDesc }}</p> {# 显示Tag的简介 #}
    {% endif %}
    {% tagDetail tagLogo with name="Logo" %}
    {% if tagLogo %}
        <img src="{{ tagLogo }}" alt="{{ tagInfo }}" class="tag-logo"> {# 显示Tag的Logo #}
    {% endif %}
</div>

This code will display the name, description, and Logo of the Tag at the top of the Tag document list page, providing users with more comprehensive Tag information.

The value of Tag label as a content association entry

Tag label plays multiple roles in Anqi CMS through the aforementioned front-end display strategy:

  • Enhance content discoverability:Users can easily find more related content by clicking on the Tag, extending the time users spend on the website.
  • Optimize the website navigation structureTag provides another content organization method other than categorization, enriching the internal links and navigation hierarchy of the website.
  • Enhances SEO effectivenessEach Tag page is an independent special topic page,配合custom URL and SEO meta information, helps attract search engine crawling, and improve keyword ranking.
  • Encourage user participation: Clear Tag display helps users understand the structure of the website content and encourages them to explore and interact.

Summary

The Tag label feature of AnQi CMS is a powerful and flexible tool that allows content operators to manage and associate content more finely.By carefully designing the tag information in the backend and the front-end display, we can transform the Tag tag from a simple keyword into an important hub in the website content ecosystem, bringing users a more smooth and in-depth browsing experience, and also injecting new vitality into the website's SEO performance.

Frequently Asked Questions (FAQ)

Q1: What is the difference between Tag tags and categories in Anqi CMS? A1:Categories usually represent the hierarchical structure of content, with clear hierarchical relationships, used to organize a wide range of content topics.And the Tag tag is more like a key word or topic of the content, which can cross different categories and associate the content horizontally.A content can belong to a category but can have multiple Tag tags to achieve more granular content organization and multidimensional content association.

What are the benefits of setting a 'custom URL' for Tag tags? A2:There are two main benefits to setting a custom URL for Tag tags: one is to improve user experience, making the URL more readable and memorable;Secondly, it greatly optimizes SEO, search engines prefer semantic and clear URL structures, which helps improve the inclusion and ranking of Tag pages.At the same time, custom URLs also avoid the problem of unattractive or not meeting business needs due to the system's default ID.

Q3: How to implement pagination on the Tag tag list page or the document list page under Tag? A3:In AnQi CMS, you can enable pagination by using thetagListortagDataListthe tag withtype="page"parameter. Once enabled,type="page"You can follow the code block immediately after usingpaginationtag to generate page navigation links.paginationTags can be configuredshowParameters to control how many pagination page numbers are displayed, thereby providing users with a complete page turning experience.

Related articles

How to set a default thumbnail to ensure that documents without uploaded images also have a unified display?

When using AnQi CMS to manage website content, we often encounter such situations: some articles, products, or pages may not have uploaded exclusive thumbnails due to insufficient content or oversight.This not only makes the website page look unprofessional and inconsistent, but may also affect users' desire to click on the content.Luckyly, Anqi CMS provides a very practical feature that can solve this problem once and for all - that is, setting a default thumbnail to ensure that even documents that do not upload pictures separately can have a unified and beautiful display effect.Why is it necessary to set a default thumbnail

2025-11-09

How different thumbnail processing methods (aspect ratio scaling, padding, cropping) affect the display effect of images on the front-end?

In website operation, images play a vital role, especially in places like list pages and detail pages where thumbnails are displayed. They not only affect the beauty of the page but also directly relate to the click-through rate and reading experience of users.AnQiCMS (AnQiCMS) offers various flexible thumbnail processing methods to help users meet the needs of image display in different scenarios.Understanding how these methods - scaling, padding, and cropping - affect the final presentation of images on the front end is particularly important for optimizing the visual experience of a website.Why is thumbnail processing so crucial

2025-11-09

How to optimize front-end loading and display by converting and automatically compressing images within the site to Webp format?

Optimize the website front-end loading and display, images are one of the key links.For us who pursue efficiency and a good user experience, it is crucial to properly handle the images on the site.The AnQiCMS (AnQiCMS) provides very practical functions in this aspect, through WebP format conversion and automatic compression, we can significantly improve the loading speed and image display effect of the website.We all know that large image files are a common cause of slow website loading.This will not only affect the user experience and increase the bounce rate, but also have a negative impact on search engine optimization (SEO)

2025-11-09

How to automatically handle or manually set image lazy loading for document content in AnQiCMS to improve display performance?

In today's fast-paced online environment, website loading speed is crucial for user experience and search engine rankings.Images are often an important part of web page content and can also be a key factor affecting page loading performance.This problem was solved by the emergence of lazy loading technology for images.AnQiCMS as an efficient content management system, provides us with flexible image optimization and lazy loading implementation solutions.Understanding Image Lazy Loading and Its Importance

2025-11-09

How to implement the links and title display of the previous and next document pages on the content detail page?

In website operation, the navigation function of the previous and next pages on the content detail page may seem trivial, but it has a significant impact on user experience and the SEO performance of the website.It not only guides users to continue browsing more related content, improving the depth and stay time of page visits, but also provides a clear page flow for search engine crawlers, helping to index and rank the website's content.For those who use AnQiCMS to manage content, achieving this function is very direct and efficient

2025-11-09

How to retrieve and display a list of related documents based on the current document to enhance content relevance?

How to keep visitors immersed in your site after they have finished reading an exciting article and discover more interesting information?One of the answers is to intelligently display relevant documents. This can effectively enhance user experience, extend the time users spend on the website, and for search engine optimization (SEO), it can also help spiders better crawl and understand the website structure through the construction of internal links, thereby improving the relevance of the content and the overall weight of the website.In Anqi CMS, it is not a complex thing to get and display the list of related documents

2025-11-09

How to flexibly call and display custom fields in front-end templates?

When using AnQi CMS to manage website content, its powerful content model and custom field features provide great flexibility for the personalized needs of the website.At times, we not only need to publish regular article titles, content, etc., but also need to add some unique information for specific types of articles or products, such as the author of the article, product model, launch date, and special selling points.This information is implemented through the content model custom fields.How can I flexibly call and display these custom fields in a website front-end template?This is the issue we are going to delve into today.

2025-11-09

How to use the `archiveFilters` tag to implement dynamic display of a multi-condition filter list?

How can we make it quick for users to find the information they need on the website, which is a key factor in improving user experience and conversion rate.When a website contains a variety of content, and each type of content has multiple attributes to choose from, providing a flexible multi-condition filtering function becomes particularly important.AnQiCMS provides a powerful `archiveFilters` tag that can help us easily implement dynamic filtering of content lists, making your website content come to life.Why do we need multi-condition filtering? Imagine that you are browsing a real estate website

2025-11-09