The `pageList` tag defaults to fetching which single page data from the website?

Calendar 👁️ 73

As an experienced website operation expert, I am well aware of the efficiency and flexibility of AnQi CMS in content management. Today, let's delve into an important member of the AnQi CMS template tag system -pageListLabels, especially those that are retrieved by default from which single-page data on the website. Understanding this is crucial for our efficient content presentation and template design.


In-depth analysis of AnQi CMSpageListLabel: What single-page data is retrieved by default?

In the world of AnQiCMS, the single-page (Page) plays a role in the website that is relatively static, independent in content, but indispensable, such as "About Us", "Contact Us", "Privacy Policy", and so on.They do not update as frequently as articles or products, but they carry the basic information and brand image of the website.To facilitate developers and operators to flexibly call and display these single-page applications, AnQiCMS provides intuitive and powerfulpageList.

Get to knowpageListThe core role of tags

pageListThe label, as the name suggests, is mainly responsible for retrieving the list of single-page pages on the website.Its design philosophy embodies the simplicity and efficiency of AnQiCMS.In the template, we usually use{% pageList pages %}...{% endpageList %}Use this structure, among other things,pagesIs the variable name defined for the collection of single-page data obtained.

Core revelation:pageListthe default behavior

Now, let's hit the core of the topic:pageListWhat single-page data does the tag retrieve by default on a website?

The answer is: when you use the templatepageListwhen you tag the document, ifNo additional parameters are specified(exceptsiteIdwhich usually defaults to the current site, and needs to be specially paid attention to in a multi-site environment), it will obtain and present everything without reservationall the single page data that has been published on the current website.

This means that, whether it is the "About Us" you created under "Page Resources" and "Page Management" in the background, or the "Service Agreement", or even the "Disclaimer", as long as they are single-page pages that have been published,pageListLabels will take them all into their data collection.It does not preset any filtering conditions, but instead packages all the basic information of single pages to provide to you, allowing template developers to have the greatest freedom to decide how to display, filter, or sort this data.

Specific to each single page,pageListLabels will provide the following key information by default:

  • Single page ID (Id): Unique identifier for each single page.
  • Single page title (Title): For example, 'About Us' or 'Contact Information'.
  • Single page link (Link): Visit the URL of this single page.
  • Single page description (Description): Brief overview of the content of this single page.
  • Single page content (Content): Full HTML or Markdown content on a single page (depending on backend settings whether it is rendered as HTML).
  • Single page thumbnail full image (Logo)If the main image is uploaded on a single page, the address of the large image will be provided here.
  • Single page thumbnail (Thumb)If the thumbnail is uploaded on a single page, the address of the thumbnail will be provided here.

These fields constitute the basic profile of each single page, ensuring that you can flexibly call and display this information in the template as needed.

Practical Application: Mastering Single Page Data Flexibly

UnderstoodpageListAfter the default behavior, we can use it flexibly in the template.

The most common usage is to iterate over all single pages, for example, you might want to display some important single page links in the footer area of the website:

<ul>
{% pageList pages %}
    {% for item in pages %}
    <li>
        <a href="{{ item.Link }}">{{item.Title}}</a>
    </li>
    {% endfor %}
{% endpageList %}
</ul>

due topageListDefault to retrieve all pages, if you want to exclude certain pages from displaying (for example, you do not want the "Privacy Policy" to appear in the footer), you need toforWithin the loop, perform conditional judgment. This "get all first, then filter as needed" pattern gives the template great flexibility, avoiding the complexity of overloaded tag parameters:

<ul>
{% pageList pages %}
    {% for item in pages %}
    {# 假设隐私政策的ID是5,或者标题是“隐私政策” #}
    {% if item.Id != 5 and item.Title != "隐私政策" %}
    <li>
        <a href="{{ item.Link }}">{{item.Title}}</a>
    </li>
    {% endif %}
    {% endfor %}
{% endpageList %}
</ul>

In this way, we can easily adjust the display strategy of a single page dynamically according to the business logic without modifying the parameters of the tag itself.

Summary

AnQiCMS'pageListThe tag provides a unified entry point for all single-page data on the website with its simple and powerful default behavior.It does not preset complex filtering logic, but instead gives full control to the template developer, through conditional judgments and loop controls within the template, achieving fine-grained management and personalized display of single-page data.This design concept is a reflection of the balance between content operation efficiency and flexibility in AnQiCMS.


Frequently Asked Questions (FAQ)

Q1:pageListDoes the tag support pagination functionality?

A1: According to the design of AnQiCMS,pageListTags are mainly used to obtain the list data of a single page, itdoes not provide pagination parameters directly(such aslimitortype="page")。A single page usually contains a limited number, such as 'About Us', 'Contact Us', etc., so it is designed by default to retrieve all data at once.If you have a few single-page pages that need to be displayed in batches, you can use them inside the templateforrepeatedlysliceFiltering and other methods can be used for limited simulation, but when facing a large number of single-page applications that require complex pagination, it may be necessary to consider adjusting the content model or carrying out secondary development.

Q2: How to retrieve only specific single pages instead of all pages?

A2:pageListThe label itself does not have a direct ID or title filter parameter to limit the number of items obtained.It defaults to fetching all published single-page data. To display only specific pages, you need to do so after you have retrieved all the page data, inforUse conditional judgment statements inside the loop (such as{% if item.Id == X or item.Title == "Y" %}) Selectively display the pages you need. For example, if you want to display pages with IDs 1 and 3, you can write it like this:

{% pageList pages %}
    {% for item in pages %}
        {% if item.Id == 1 or item.Id == 3 %}
            <li><a href="{{ item.Link }}">{{item.Title}}</a></li>
        {% endif %}
    {% endfor %}
{% endpageList %}

Q3: If I want to display a single-page list in the website navigation but do not want to show the 'Site Map' page, what should I do?

A3: This is very simple, just need to traversepageListreturnedpagesUtilize dataifUse logical judgment to exclude the 'site map' page. You can exclude it by the page title or ID. For example:

<nav>
    <ul>
    {% pageList pages %}
        {% for item in pages %}
            {# 假设“站点地图”的标题是“站点地图”,或者知道其ID #}
            {% if item.Title != "站点地图" %}
                <li><a href="{{ item.Link }}">{{item.Title}}</a></li>
            {% endif %}
        {% endfor %}
    {% endpageList %}
    </ul>
</nav>

This approach gives you great flexibility at the front-end template level, allowing you to easily implement content filtering without modifying the backend logic or tag definitions.

Related articles

What is the basic syntax structure of the `pageList` tag in AnQiCMS?

## Deeply analyze the basic syntax structure of the `pageList` tag in AnQi CMS Among the powerful functions of AnQi CMS, template tags play a vital role as the bridge connecting backend data with frontend display.For the common single-page content such as 'About Us', 'Contact Us', 'Terms of Service', and others on the website, Anqi CMS provides a simple and efficient tool for management and presentation, that is the `pageList` tag.

2025-11-07

How to call single page detail data of other sites in a multi-site management environment?

Good, as an experienced website operation expert, I am happy to analyze for you how to efficiently and flexibly call the single page detail data of other sites in the multi-site management environment of AnQiCMS. --- ## Secure CMS Multi-site Management: Easily Handle Cross-site Single Page Detail Data Calls In today's rapidly changing digital world, many businesses and content operations teams face the challenge of managing multiple websites.

2025-11-07

How to use the `token` (URL alias) parameter in the `pageDetail` tag?

AnQiCMS (AnQiCMS) is an efficient and flexible enterprise-level content management system that provides many conveniences in content publishing and SEO optimization.The flexible application of URL alias (`token`) parameters is crucial for enhancing the user experience and SEO-friendliness of the website.Today, let's delve deeper into how to fully utilize the `token` parameter when using the `pageDetail` tag in AnQiCMS templates.

2025-11-07

Besides ID, which parameter can be used to specify the single page to be retrieved?

As a senior website operations expert, I am well aware that how to flexibly and efficiently locate and obtain specific content in a content management system is the key to improving operation efficiency and website SEO performance.AnQiCMS provides very practical mechanisms in single-page management, in addition to the most common way to specify a single page through ID, there are actually parameters that are more in line with the operational thinking that can be utilized.Today, let's delve deeply into this topic.

2025-11-07

How to use the `for` loop to iterate over all single pages returned by the `pageList` tag in the AnQiCMS template?

In the world of AnQiCMS, flexibility and efficient management of content are its core advantages.Whether it is to publish corporate news, product details, or build a complex content matrix for multiple sites, AnQiCMS can provide strong and intuitive support.Today, as an expert operator who is well-versed in the field, I want to discuss with everyone a very practical skill in AnQiCMS template creation: how to skillfully use the `for` loop tag to traverse and display all the single page content returned by the `pageList` tag.

2025-11-07

What core fields does each single page object returned by the `pageList` tag contain (such as ID, title, link)?

As an experienced website operations expert, I know that fully understanding the details of template tags in an efficient content management system like AnQiCMS is the key to fine-grained operations and content presentation.Today, let's delve into the `pageList` tag, an important tool for obtaining a single-page list, and explore the core fields and operational value contained in each single-page object (`item`).

2025-11-07

How to correctly add basic pagination tag features to the article list in AnQiCMS?

In the digital age where content is king, the website's content list carries the primary entry point for users to explore information and understand products.A well-designed, smooth experience article list can not only effectively improve the user's stay time on the website, but also help users quickly find the information they need through accurate navigation guidance.AnQiCMS (AnQiCMS) is an efficient and flexible content management system that understands this well, providing website operators with powerful and easy-to-use template tag functions, among which, adding basic pagination functions to the article list is a key factor in improving user experience and website accessibility.

2025-11-07

What is the role of the `show` parameter of the `pagination` tag? How to control the number of page numbers displayed at the bottom of the page?

As an experienced website operations expert, I know that it is crucial to effectively guide users to browse and discover information when managing a large amount of content.The pagination feature is the bridge that connects users to the deep content of the website.In AnQiCMS (AnQiCMS) such an efficient and customizable content management system, flexible use of pagination tags can greatly enhance user experience and the professionalism of the website.Today, let's delve into a core parameter of the `pagination` tag in AnQiCMS, namely `show`, and see what its role is

2025-11-07