What parameters does the `{% tagDataList %}` tag support to refine

Calendar 👁️ 61

Hello! As an experienced website operation expert, I am very willing to give you a detailed interpretation of AnQiCMS in{% 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. And{% tagDataList %}Tags are used to retrieve the core tools associated with documents from these rich tags as needed. Understanding and effectively using its parameters will greatly enhance your website's content management capabilities.


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

{% tagDataList %}The core responsibility of the tag is to filter out the document list associated with the specified tag ID. Its basic usage is{% tagDataList archives with tagId="1" %}...{% endtagDataList %}of whicharchivesThis is the custom variable name for the document list we have obtained, whiletagId="1"then specifies the target label.

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

Core identification parameters:tagId

As the name implies,tagIdThis is the most core parameter of the tag, it is used to specify which tags of documents you want to get. Usually, you will provide a specific tag ID, for exampletagId="5"To retrieve all documents associated with the tag having ID 5.

It is worth noting that if you use this tag on the tag detail page (i.e., the current page is already related to a specific tag) and do not specify it explicitlytagIdthen{% tagDataList %}It will intelligently automatically identify the tag ID of the current page and retrieve the associated document.This brings great convenience to building label topic pages, without the need to hardcode label IDs, the template can automatically adapt.

Content model filtering:moduleId

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

For example, if you want to display only documents related to the "Go language" tag under, excluding products or event information, you can setmoduleId="1"(Assuming the article model ID is 1). It's like being in a vast library, where not only do you specify the topic, but you also make it clear that you only want to consult the 'books' category, rather than magazines or newspapers.This is crucial for maintaining the professionalism and relevance of content display.

Content sorting strategy:order

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

  • id desc: Sort by document ID in descending order, which usually means the latest documents are listed first, suitable for displaying the latest dynamics.
  • views desc: Sort documents by viewing volume in descending order to highlight popular documents and attract more attention.
  • sort descIf you have customized the sorting of the document in the background, use this parameter to display the 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. Based on your operational strategy, you can flexibly choose the sorting method that best suits the current content module, whether it is emphasizing timeliness, popularity, or the importance of manual intervention.

Quantity and pagination control:limitwithtype

The length of the content list and the pagination method directly relate to the page loading speed and user browsing experience.limitandtypeParameters work together to provide strong 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". More advanced usage allows you to also go throughoffsetA pattern to skip a certain number of documents before retrieving, for examplelimit="2,10"Indicates starting from the third document and fetching 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"(This is also the default value),{% tagDataList %}It will simply return bylimitthe number of documents specified by the parameter, without involving pagination logic.
    • When set totype="page"It will inform the system that this is a document list that requires pagination. At this point, you can work with AnQiCMS's{% pagination %}To build a complete pagination feature. This means that users can browse all matching documents by clicking on "Previous page", "Next page" or page numbers, greatly enhancing the accessibility of a large amount of content.

Cross-site content calling:siteId

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

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

Coordinated with pagination tags:pagination

AlthoughpaginationItself is not{% tagDataList %}The direct parameter, but it is withtype="page"The parameters work closely together to implement the pagination function of the tag document list. When{% tagDataList %}oftypeSet to"page"After that, you can use it in the subsequent part of the template{% pagination pages with show="5" %}to generate page navigation with such tags.pagesThe variable will betagDataListImplicitly passed, which includes the total number of items, total page number, current page number, and links to previous, next, and middle page numbers, etc.show="5"It controls the maximum number of page buttons displayed in the pagination navigation.

This design decouples the content list and pagination logic, making the template structure clearer and easier to maintain. You can useforLoop throughpages.PagesRender specific page link andpages.PrevPage/pages.NextPageUse properties to build prev/next navigation.


Practical operation and strategy advice

Understood{% tagDataList %}The various parameters, next we think about how to apply this knowledge in actual operation:

  • Special topic aggregation pageCreate a special topic page for each hot tag, usingtagId(Automatic recognition) andmoduleId(If only articles are displayed), cooperatetype="page"and{% pagination %}To build a rich and easy-to-browse special topic list."),
  • Sidebar recommendation: In the sidebar of the article detail page, use the current article's tag ID, throughlimit="5"andorder="views desc"Display popular articles related to this article to enhance user stay time.
  • Modular display on the homepageOn the homepage of the website, you can set multiple content modules, each using differenttagId/moduleIdandlimitParameters, for example, "Latest Technology News" (tagId=X, order=id desc, limit=8), "Popular Product Recommendations" (tagId=Y, moduleId=2, order=views desc, limit=4).
  • SEO optimization: By aggregating pages with tags, combined with precise content titles and descriptions, search engines can better understand the structure of your website content and improve the ranking of specific thematic keywords.

Mastering the flexible application of these parameters will make you more agile in the content operation of AnQiCMS, whether it is to improve user experience, optimize SEO, or find a suitable solution for complex content display requirements.


Frequently Asked Questions (FAQ)

  1. Ask: Why did I settagId,{% tagDataList %}Why doesn't it display any documents?Answer: There are usually several reasons. First, make sure you have provided the following.tagIdIt is correct, and there is indeed a tag corresponding to the ID in the background. Next, check whether the tag under it is really associated with published documents. In addition, if you use it simultaneouslymoduleIdPlease confirm that the associated documents belong to the specified model and that their status is published rather than draft or deleted.

Related articles

How to display the list of all associated documents under the Tag tag detail page?

As an experienced website operations expert, I am well aware of the core role of tags (Tag) in content management and website optimization.A well-designed tagging system not only enhances user experience and helps visitors quickly find the content they are interested in, but is also an indispensable part of search engine optimization (SEO).AnQiCMS provides very flexible and powerful support for the Tag tag function, making it easy for us to achieve this goal.

2025-11-06

The `{% tagDetail %}` tag can get which field data of Tag?

As an experienced website operations expert, I deeply understand the strong potential of Anqi CMS in content management and SEO optimization.Today, we will delve into a very practical template tag in AnQiCMS——`{% tagDetail %}`, which can help us manage and display website tag data more finely, thereby improving user experience and search engine friendliness.

2025-11-06

If you want to get the details of a Tag label (such as name, link, description), which template tag should you use?

As an experienced website operations expert, I know that flexibly using template tags in such an efficient content management system as AnQiCMS is the key to improving the efficiency of website content display and management.Especially for content organization forms like Tag tags, which are very important, it is crucial to accurately obtain and display their detailed information, which is essential for SEO optimization and user experience.

2025-11-06

How to use the `{% tagList %}` tag to filter and display Tags in alphabetical order?

As an experienced website operations expert, I know that the organization and presentation of website content is crucial for user experience and Search Engine Optimization (SEO).AnQiCMS (AnQiCMS) provides powerful tools for content managers with its flexible template engine and rich tag system.Today, let's delve deeply into a common yet somewhat challenging requirement: how to elegantly sort and display the Tag of the website using the `{% tagList %}` tag.

2025-11-06

How to display the Banner image list through the `bannerList` tag on the Anqi CMS homepage?

As an experienced website operations expert, I am well aware of the importance of the homepage banner for website visual appeal, user guidance, and brand promotion.In AnQiCMS such an efficient and flexible content management system, making good use of its built-in tags can help us easily achieve various content display needs.Today, let's delve into how to skillfully use the `bannerList` tag on the homepage of AnQiCMS to display your exquisite Banner image list.--- ### AnQiCMS and Banner

2025-11-06

What are the required or commonly used parameters of the `bannerList` tag to configure the home page banner?

As an experienced website operations expert, I fully understand the importance of the homepage banner for the first impression of website visitors and the guidance of user behavior.In AnQiCMS, the `bannerList` tag is the core tool we use to manage and present these key visual elements.It features a concise and powerful design that allows content operators to easily achieve diverse homepage banner display needs.

2025-11-06

How to use `for` loop to iterate over multiple home page Banner items obtained from `bannerList`?

In modern web design, the homepage banner is undoubtedly an important window to attract users' attention and convey core information.A dynamic and beautiful banner area can greatly enhance the visual appeal and user experience of a website.As an experienced website operation expert, I am well aware of the powerful and flexible content management of AnQiCMS (AnQi CMS).

2025-11-06

How to set the image link (`Link`) for each Banner in `bannerList`?

As an experienced website operations expert, I am well aware of the importance of every detail for website user experience and operation effectiveness.The banner (Banner) serves as the 'face' of the website, not only carrying the responsibility of beauty, but also as a key point for guiding users and conveying core information.In an efficient and flexible system like AnQiCMS, setting precise image links (`Link`) for each Banner is the basis for achieving this goal.

2025-11-06