Hello! As an experienced website operations expert, I am more than happy to give you a detailed explanation of AnQiCMS.{% tagDataList %}The various parameters supported by the label and how to skillfully use them to build more accurate and attractive content display.

In AnQiCMS, content tags (Tag) are an important way to organize and associate content, which can help users quickly find topics of interest.{% tagDataList %}The label is a core tool used to retrieve associated documents from these rich labels as needed. Understanding and effectively using its parameters will greatly enhance your website content management capabilities.


Precisely grasp the content context:{% tagDataList %}Parameter parsing of tags

{% tagDataList %}The core responsibility of tags is to filter out the document list associated with the specified tag ID. Its basic usage is{% tagDataList archives with tagId="1" %}...{% endtagDataList %}where,archivesis the custom variable name for the document list we obtain,tagId="1"which specifies the target label.

In order to meet various complex display requirements, AnQiCMS provides multiple flexible parameters for this tag. Below, we will delve into them one by one:

Core identification parameters:tagId

As the name suggests,tagIdThis is the core parameter of this tag, used to specify which tags under which documents you want to obtain. Usually, you will provide a specific tag ID, such astagId="5"To get all documents associated with the tag with ID 5.

It is worth mentioning that if you use this tag on the tag detail page (i.e., the current page itself is related to a specific tag) and do not specify it explicitlytagIdso that{% tagDataList %}It will automatically recognize the tag ID of the current page and retrieve the associated document.This brings great convenience for building tag topic pages, no need for hard-coded tag ID, the template can adapt automatically.

Content model filtering:moduleId

In an AnQiCMS system that supports multiple content models, content is not limited to articles, but may also include products, activities, and other types.moduleIdThe parameter allows you to accurately filter out documents under specific content models.

For example, if you want to display only documents related to the "Article" model under the "Go Language" tag, and exclude product or event information, you can setmoduleId="1"(Assuming the article model ID is 1).This is like in a vast library, where you not only specify the topic but also clearly indicate that you want to read only 'books' in this category, rather than magazines or newspapers.This is crucial for maintaining the professionalism and relevance of content display.

Content sorting strategy:order

The display order of content directly affects user experience and information acquisition efficiency.orderThe parameters give you control over the sorting method of the document list. AnQiCMS provides a variety of sorting rules:

  • id desc:Sorted by document ID in reverse order, usually meaning the most recently released documents are at the top, suitable for displaying the latest updates.
  • views desc:Sort documents by view count in descending order to highlight popular documents and attract more attention.
  • sort desc:If you have customized the sorting of documents in the background, use this parameter to display content according to the priority you set.

By default, if you do not setorderThe system will use the custom sorting rules defined in the background.According to your operational strategy, you can flexibly choose the sorting method that best suits the current content module, whether emphasizing timeliness, popularity, or the importance of manual intervention.

Number and pagination control:limitWithtype

The length of the content list and the pagination method are directly related to the page loading speed and user browsing experience.limitandtypeThe parameters work together to provide powerful control.

  • limitThis parameter is used to set the number of documents you want to display. If you need to get the first 10 documents, just setlimit="10"You can also use more advanced methods byoffsetTranslate the content of `value` from `auto` to `English`, and return the result in the same JSON array format.limit="2,10"Represents starting from the 3rd document and retrieving 10 documents. This is very useful for scenarios such as skipping a few articles that have already been displayed at the top in the 'Recommended Articles' feature.

  • typeThis parameter determines the type of the list.

    • When set totype="list"at the moment (which is also the default value),{% tagDataList %}It will simply return bylimitdocuments specified by the parameter, without involving pagination logic.
    • When set totype="page"It will inform the system that this is a paged document list when it happens. At this time, you can work with AnQiCMS's{% pagination %}Now you can build a complete pagination feature with tags.This means that users can browse all matching documents by clicking on "Previous Page

Cross-site content call:siteId

AnQiCMS supports multi-site management, this powerful feature is also extended to the call of content tags.siteIdThe parameter allows you to call tag documents under other AnQiCMS sites at the current site.

In most cases, you do not need to set this parameter, the tags will automatically obtain the data of the current site. However, if you are operating multiple strongly related sites and want to aggregate and display specific tag content of other sites on one site, you only need to specify the target site'ssiteIdIt can easily achieve cross-site content integration and provide technical support for your multi-site operation strategy.

Cooperate with pagination tags:pagination

AlthoughpaginationItself is not{% tagDataList %}The direct parameter, but it is withtype="page"Parameters closely cooperate to jointly implement the pagination function of the label document list. When{% tagDataList %}oftypeis set to"page"after that, you can use the subsequent part of the template to{% pagination pages with show="5" %}such labels to generate page navigation.pagesvariables will betagDataListImplicit passing, which includes detailed information such as the total number of items, the total number of pages, the current page number, and the links to the previous, next, and middle page numbers.show="5"This controls the maximum number of page navigation buttons displayed.

This design decouples the content list and pagination logic, making the template structure clearer and easier to maintain. You can throughforto iteratepages.PagesTo render specific page link, andpages.PrevPage/pages.NextPageetc. properties to build previous/next page navigation.


Operations实战与Strategy建议

Understood{% tagDataList %}The various parameters, next let's think about how to apply these knowledge in actual operation:

  • Special Topic Aggregate Page: Create a special topic page for each hot tag, usingtagId(Automatic Recognition) andmoduleId(If only the article is displayed), in coordination withtype="page"and{% pagination %}To build a rich and easy-to-navigate special topic list.
  • Sidebar Recommendations: In the sidebar of the article detail page, use the current article's tag ID, throughlimit="5"andorder="views desc",Display “Articles Related to This Article” to popular articles, enhancing user stay time.
  • Module-based display on the homepage: On the homepage of the website, you can set multiple content modules, each using differenttagId/moduleIdandlimitParameters, such as "Latest technological trends
  • SEO optimizationThrough tag aggregation pages, combined with precise content titles and descriptions, search engines can better understand the structure of your website's content and enhance the ranking of specific topic keywords.

Master the flexible application of these parameters, and it will allow you to operate AnQiCMS content more skillfully. Whether it is to improve user experience, optimize SEO, or meet complex content display needs, you can find appropriate solutions.


Common Questions and Answers (FAQ)

  1. Question: Why did I settagId,{% tagDataList %}However, it does not display any documents?Answer: There are usually several reasons. First, please make sure you provide the following.tagIdIt is correct, and there is indeed a tag corresponding to this ID in the background. Next, check whether there are actually published documents associated with this tag. In addition, if you are usingmoduleIdParameters, please confirm that the associated documents belong to the model you specified, and that the status of these documents is published rather than draft or deleted.