Create an independent Tag detail page in AnQiCMS (tag/index.html)
As an experienced website operations expert, I am well aware of the great potential of tags (Tag) in content organization and search engine optimization (SEO).A well-designed tag page that can not only help users find related content quickly, but also bring valuable long-tail traffic to the website.AnQiCMS as an enterprise-level content management system developed based on the Go language excels in providing efficient and customizable content management solutions. Its flexible template engine and rich built-in tags are the powerful weapons we use to create independent Tag detail pages.
Today, let's delve into how to create and optimize an independent Tag detail page in AnQiCMS, that istag/index.htmlLet each tag have its own unique and SEO-friendly display space.
Why do you need an independent Tag detail page?
In many CMS, tags may simply be metadata associated with content, and their page display is often rather simple, just a list of related articles.However, in AnQiCMS, we can go beyond this basic mode, creating independent, rich detail pages for each tag.This brings multiple operational values:
- Improve SEO performance: Independent
tag/index.htmlThe page can have a unique TDK (title, keywords, description) and can write a dedicated introduction according to the tag theme.This makes the search engine better understand the theme of the page, improve the ranking of relevant keywords, and capture more accurate traffic. - Enhance user experienceA detailed Tag details page with clear categorization and good layout, allowing users to get a deeper content navigation after clicking the tag, rather than simply jumping to a chaotic list.This helps to reduce the bounce rate and improve user stay time on the site.
- Aggregate content: The tag page aggregates all related content together, whether it is articles, products, or other custom model content, which can be displayed in a centralized manner, forming a specific theme 'micro topic', greatly enhancing the organization and discoverability of content.
- Provide more marketing opportunitiesOn an independent Tag detail page, we can freely insert promotional information, recommended products, or internal links related to the tag topic, providing more entry points for content marketing and conversion.
How does AnQiCMS organize the Tag page template?
AnQiCMS's template system is very flexible, it follows the Django template engine syntax, using.htmlFiles as templates. All template files are stored in/templateUnder the directory, each template has its own subdirectory. For the Tag page, AnQiCMS provides clear template conventions:
- Tag homepage:
template/{你的模板目录}/tag/index.html - Tag document list page:
template/{你的模板目录}/tag/list.html(usuallytag/index.htmlwill integrate the document list function)
We mainly focus ontag/index.htmlbecause it represents the 'home' of a specific tag. When a user visits a specific Tag's URL (for example/tag-{id}.htmlor/tag/标签别名), the system will rendertag/index.htmlthis template.
Core feature: build the key tags of the Tag detail page
To create a feature-complete Tag detail page, we need to flexibly use the built-in template tags provided by AnQiCMS. Here are several crucial tags and their usage:
1. Retrieve the information of the Tag (tagDetail)
This is the core of the page, used to obtain all the details of the current visited tag, including title, description, even custom content and Logo.
Usage example:
{% tagDetail currentTag with name="Title" %} <h1>{{ currentTag }}</h1> {% tagDetail tagDescription with name="Description" %} <p>{{ tagDescription }}</p> {# 如果标签在后台有独立的内容字段,也可以调用 #} {% tagDetail tagContent with name="Content" %} <div class="tag-intro">{{ tagContent|safe }}</div> {% tagDetail tagLogo with name="Logo" %} {% if tagLogo %}<img src="{{ tagLogo }}" alt="{% tagDetail with name='Title' %}" />{% endif %}By
tagDetailThe label, we can get the current Tag's ID, title, link, description, index letter, as well as the Logo and rich text content set in the background.This information is the foundation for building the core content of the page.
2. Display the list of related documents (tagDataList)
A tag detail page naturally needs to display the association with the tag