As an experienced website operations expert, I am well aware that in today's highly competitive digital environment, every detail can affect the visibility and user experience of a website.AnQiCMS provides a powerful tool for our refined operations with its high efficiency, flexibility, and SEO-friendliness.tagDetailLook at how it helps us accurately obtain and optimize the SEO title and description information of the specified Tag (label) page.
Mastering Tag Page SEO:tagDetailThe mystery of tags
In Anqi CMS, a tag (Tag) is not just a way to categorize content, but also an important position for building the internal link structure of the website and capturing long-tail keyword traffic.A well-optimized Tag page that can provide users with more accurate content aggregation, and also show the depth and breadth of the website's content to search engines.However, in order for these Tag pages to stand out in search engines, we need to meticulously customize their SEO titles (Title) and descriptions (Description).
At this point, the Anqi CMStagDetailTags have become an indispensable tool for us.It gives us the ability to directly access detailed information about a single Tag in the template, which naturally includes the SEO title and description we care about.
Deep understandingtagDetailtags
tagDetailThe design of the label is intended to obtain detailed data for a specific Tag. Its basic usage is very intuitive, as if it has had an efficient conversation with the data layer of Anqi CMS:
{% tagDetail 变量名称 with name="字段名称" id="1" %}
Or, if you want to get by the Tag's URL alias, you can usetokenParameters:
{% tagDetail 变量名称 with name="字段名称" token="别名" %}
Among them:
变量名称This is an optional parameter, used to assign the obtained data to a temporary template variable for easy reference in subsequent code.name="字段名称"This is a core parameter, through which we specify which specific information of the Tag we want to retrieve, such as title, description, link, etc.id="1"When you want to retrieve data for a specific Tag, you can explicitly specify the ID of that Tag.token="别名"If your Tag has set a URL alias (usually for better SEO-friendly URLs), you can also retrieve data using this alias.
It is worth mentioning that if you omit in the Tag page (for exampletag/index.htmlortag/list.htmlthis kind of template specifically displaying Tag content)idandtokenparameters,tagDetailThe tag will intelligently automatically retrieve the detailed information of the Tag on the current page, which greatly simplifies our template writing work.
Accurately obtain SEO title and description
Now, we focus on how to utilizetagDetailTo get the SEO title and description of the Tag page, use the tag to access.In the AnQi CMS backend management interface, when we edit a Tag, there are two fields available for us to fill in: 'SEO Title' and 'Tag Description'.tagDetailTagged throughTitlefield to display the "SEO Title", byDescriptionfield to display the "Tag Description".
obtaining the SEO title of the Tag (Title)
The SEO title of a tag usually displays in the browser tab and the search engine results page, and is a key factor to attract users to click. UsetagDetailIt's very simple to get it:
<title>{% tagDetail with name="Title" %}</title>
If you want to assign the Tag title to a variable for other operations, such as adding prefixes or suffixes, you can do it like this:
{% tagDetail currentTagTitle with name="Title" %}
<title>{{ currentTagTitle }} - 您的网站名称</title>
If it is not on the current Tag page, you need to get the SEO title of a specific Tag, for example, the Tag with ID 10:
{% tagDetail specifiedTagTitle with name="Title" id="10" %}
<title>{{ specifiedTagTitle }}</title>
Get the SEO description of a Tag (Description)
SEO description is also an important factor affecting click-through rate, it usually appears below the title in the search engine results page, providing a brief summary of the page content.tagDetailAlso, it's convenient to get the Tag description information:
<meta name="description" content="{% tagDetail with name="Description" %}">
Similarly, you can also assign the description to a variable:
{% tagDetail currentTagDescription with name="Description" %}
<meta name="description" content="{{ currentTagDescription }}">
ThesetagDetailTags should be placed on the Tag page:<head>Within the area, ensure that the search engine can correctly identify these important SEO metadata when crawling the page.
Other practical fields to enhance the Tag page experience.
In addition to the SEO title and description,tagDetailtags also provide many useful fields that can help us build more rich content and better user experience Tag pages:
Link(Tag link): Retrieve the current Tag's URL for internal linking on the page or as a standard URL.<link rel="canonical" href="{% tagDetail with name="Link" %}" />Content(Tag content)If your Tag has detailed description or content set in the background (supports Markdown rendering), you can get it through this field.This is very valuable for creating content-rich Tag landing pages.<div class="tag-introduction"> {% tagDetail tagContent with name="Content" render=true %}{{ tagContent|safe }} </div>Logo(Tag thumbnail)If the Tag is configured with a representative image, the URL can be obtained through this field.<img src="{% tagDetail with name="Logo" %}" alt="{% tagDetail with name="Title" %}">
Incorporate this information ingeniously into the design of the Tag page, which not only enhances the user's understanding of the current Tag theme but also strengthens the visual appeal of the page.
Operational Tips: Maximize SEO Benefits
- Backend Fine-tuning ConfigurationIn the 'Content Management' - 'Document Tags' section of the Anqi CMS backend, make sure to fill in a unique 'SEO Title' and 'Tag Description' for each important Tag.Avoid content repetition and strive to accurately reflect the essence of the content aggregated by the Tag.
- Template File Selection: Usually, you will be
template/你的模板目录/tag/index.htmlortag/list.htmlused in templates for displaying Tag lists or Tag details.tagDetailTags. Ensure that your template structure can fully utilize these SEO information. - Multi-site Compatibility: If you operate multiple sites and wish to call Tag data across sites,
tagDetailit also supportssiteIdParameters, allowing you to easily implement a unified SEO strategy management across multiple sites.
PasstagDetailTags, Anqi CMS provides powerful customization capabilities for website operators, allowing us to manage each Tag page with the same level of SEO as we do for article detail pages, thereby enhancing the overall performance of the website in search engines.
Common Questions (FAQ)
Q1:tagDetailTags andtagListWhat is the difference between tags?
A1:tagDetailThe main function of the label is to obtainsingleDetails of Tag, such as its ID, title, description, link, etc. WhiletagListTags (document Tag list tags) are used to obtainmultipleA list of tags, commonly used in scenarios such as displaying tag clouds, related tag lists, etc. In simple terms,tagDetailFocus on depth,tagListFocus on breadth.
Q2: If the SEO title and description for Tag are not filled out in the backend,tagDetailwhat will the tag return?
A2: If you have not filled in the 'SEO Title' or 'Tag Description' for a Tag in the background Tag management, thentagDetailtag in retrievingTitleorDescriptionfield, it usually returns aEmpty stringTo ensure the SEO effect of the Tag page, it is strongly recommended to fill in complete SEO information for each important Tag.
Q3: How to set a custom URL (pseudo static rules) for Tag pages?
A3: A3: AnQi CMS attaches great importance to the SEO-friendliness of URLs.You can find the 'Custom URL' field to set it when editing Tag in the 'Content Management' -> 'Document Tags' on the backend.