How to manage and display static page content for single-page list tags `pageList` and single-page detail tags `pageDetail`?

Calendar 👁️ 95

In website operation, static pages play an indispensable role, they usually carry fixed and infrequently updated core content such as "About Us", "Contact Information", "Privacy Policy", "Service Introduction". Anqi CMS provides two powerful tools for the management and display of these pages: single page list tagspageListAnd single page detail labelpageDetail. These work together to allow you to easily manage the static content of the website, whether it's building navigation, displaying service lists, or presenting detailed corporate introductions, you can do it with ease.

Flexible management of the static page content in the background

First, let's take a look at how to manage static pages on the Anqi CMS backend.The AnQi CMS provides an intuitive and feature-rich interface for managing static pages, you can find it under the 'Page Resources' in the 'Page Management' module.

Here, you can craft each static page with the same meticulous care as you would a regular article.When creating or editing a page, you can set the page name (i.e., the title displayed on the front end), SEO title, keywords, and page description, which are key information for optimizing search engine rankings.The content editor supports rich text editing and also supports Markdown, allowing you to enrich the page layout as needed.

It is particularly worth mentioning the options of "Custom URL" and "Single Page Template".Custom URL allows you to set a friendly, descriptive link address for the page, which is not only beneficial for SEO but also convenient for users to remember and access.And the 'single-page template' gives each static page unique display capabilities.By default, the system will usepage/detail.htmlAs a single-page detail template. But if the "About Us" page needs a special layout, and the "Contact Us" page needs another design, you can specify different template files for them in the background, for examplepage/about.htmlorpage/contact.htmlThe system will intelligently recognize and apply these custom templates. In addition, you can upload Banner images and thumbnails to the page, even adjust their display order.

BypageListTag building page list

When you need to display a series of static pages in a certain area of the website, such as the navigation bar, footer links, or product service overview,pageListTags can really shine. It can retrieve all the static pages you create in the background and present them in a list.

UsepageListVery simple, you just need to define a variable in the template to receive the page list, then throughforLoop through it. For example, you may want to list pages such as 'About Us', 'Terms of Service', and 'Contact Us' in the website footer:

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

This code will iterate through all published static pages and display their titles and links. If your website has multi-site management needs,pageListit also supports getting throughsiteIdSpecify the parameter to get the list of pages under a specific site.

Sometimes, you may not want all static pages to be displayed in the list.For example, you may have a "test page" for internal reference, or you may want to exclude a specific page.At this time, you canforuse labels insideifConditional judgment to filter, for example, excluding pages with ID 1:

<ul>
{% pageList pages %}
    {% for item in pages %}
    {% if item.Id != 1 %} {# 假设ID为1的页面不希望显示 #}
    <li>
        <a href="{{ item.Link }}">{{ item.Title }}</a>
    </li>
    {% endif %}
    {% endfor %}
{% endpageList %}
</ul>

By this means,pageListThe label can flexibly organize and display a collection of static pages according to your needs.

applypageDetailThe label displays page details

When visitors click to enter a static page, you will need topageDetailThe tag is used to accurately display the specific content of this page. This tag can obtain all the details of a single static page, allowing you to display its title, content, images, and other elements on the page.

In most cases, when a user accesses a static page,pageDetailIt will automatically identify the ID or URL alias (token) of the current page and retrieve the corresponding data. This means that you only need to place it in the template file of static pages (such aspage/detail.htmlor custom by youpage/about.htmlInvoke directlypageDetailTo get the information of the current page:

<article>
    <h1>{% pageDetail with name="Title" %}</h1>
    <div class="page-content">
        {# pageDetail的Content字段支持Markdown渲染,通过render=true开启 #}
        {%- pageDetail pageContent with name="Content" render=true %}
        {{ pageContent|safe }}
    </div>
    {% pageDetail pageImages with name="Images" %}
    {% if pageImages %}
    <div class="page-banner">
        <img src="{{ pageImages[0] }}" alt="{% pageDetail with name='Title' %}" />
    </div>
    {% endif %}
</article>

In the above example, we called the page'sTitleash1title,ContentAs the main content of the page (and enabled Markdown rendering,|safeTo prevent content from being escaped, ensuring that HTML code can be parsed normally), as well as the page'sImages(usually used for Banner images) as a background or display.

If you need to get the details of a *specific* page, rather than the page you are currently visiting, you can useidortokenSpecify the parameter explicitly. For example, you may want to display part of the "About Us" page on the homepage:

<section class="about-us-summary">
    <h2>{% pageDetail with name="Title" id="5" %}</h2> {# 假设“关于我们”的ID是5 #}
    <p>{% pageDetail with name="Description" id="5" %}</p>
    <a href="{% pageDetail with name="Link" id="5" %}">了解更多</a>
</section>

By this means,pageDetailThe label can flexibly obtain and display the details of any static page, whether it is the current page or a specified page.

Combined use, maximize efficiency.

The strength of AnQi CMS lies in its seamless integration of backend management and frontend tags. Every static page you create in the backend, its custom URL, template, content, and metadata, can be accessed throughpageListandpageDetailThe label is accurately presented on the front end.

BypageListBuild a clear website structure, guide users to find important information; then throughpageDetailPresent a rich and diverse content in an attractive manner to the users.In order to enhance user experience or optimize search engine rankings, these two groups of tags provide strong support.

Frequently Asked Questions (FAQ)

  1. Ask: Why did I create a static page but still see no content on the front end?Answer: There are usually several reasons. First, make sure you have published the page in the "Page Management" backend. Second, check that the template file is using it correctly.pageDetailThe label is used to call page content. If the page has set a custom template, make sure that the template file exists and the path is correct. Moreover, if your page needs to pass throughpageListDisplay in a list and also checkpageListIs the label and its loop logic correct?

  2. Question: Does the static page content support Markdown? How to display it correctly on the front end?Answer: Yes, the Anqi CMS static page content editor supports Markdown. In the front-end template, when you use{% pageDetail with name="Content" %}you can add by calling the page contentrender=trueParameters to ensure that Markdown content is correctly rendered as HTML, for example{% pageDetail pageContent with name="Content" render=true %}{{ pageContent|safe }}Remember to add|safeA filter to ensure that HTML tags are not escaped.

  3. Ask: How can I add a link to a static page in the main navigation bar?Answer: You can configure it in the 'Background Settings' -> 'Navigation Settings' in the background.Select the navigation category you want to add a link to, then click “Add Navigation Link”.In the pop-up interface, you can select the "Link Type" as "Category Page Link" and then select the static page you want to add.This static page will appear in the navigation bar of your website.

Related articles

Category detail label `categoryDetail` how to get and display detailed information of a specific category?

In Anqi CMS website content operation, we often need to accurately obtain and display detailed information of specific categories.Whether it is displaying the name, description, or associated images and content of a category, the `categoryDetail` tag can provide flexible and powerful support to help us build dynamic and rich category pages. ### `categoryDetail` tag's core features and basic usage The `categoryDetail` tag is used to obtain detailed data for a single category.

2025-11-07

Label for category list `categoryList` how to get and display article, product category information?

Manage and display website content in AnQiCMS, the classification information plays a vital role.Whether it is to organize product catalogs or organize article topics, a clear classification structure can greatly enhance user experience and the navigation efficiency of the website.And the `categoryList` tag is a powerful tool provided by AnQiCMS, helping us to flexibly obtain and display these category information.The `categoryList` tag is mainly used to retrieve and loop through the category data on your website.

2025-11-07

How to dynamically generate and display the current page's breadcrumb navigation path? breadcrumb

In website operation, a clear navigation path is crucial for user experience and search engine optimization.Imagine, when users browse your website, it's like exploring a strange city. If they can always see where they are and how they got there, it will greatly enhance their confidence and browsing efficiency.This is the value of breadcrumb navigation (Breadcrumb Navigation).It is like a trail of breadcrumbs in your hand, providing a clear path for users from the homepage to the current page.

2025-11-07

How to build and display the hierarchical navigation menu of the website's navigation list label `navList`?

In website operation, a clear and convenient navigation menu is the key to user experience, as well as an important basis for search engines to understand the website structure.AnQiCMS provides powerful navigation management features, and its template tag `navList` is the core tool for building these hierarchical navigation menus on the front end.

2025-11-07

How to filter and paginate articles or products by conditions in the document list label `archiveList`?

In Anqi CMS, when we want to display a series of articles, products, or other content on the website page, the `archiveList` tag is an indispensable powerful tool.It can not only help us flexibly extract and display various types of content, but also perform precise filtering according to multiple conditions, and elegantly implement the pagination display of content, thereby greatly enhancing the user's browsing experience and the information organization efficiency of the website.

2025-11-07

How to retrieve and display the full content of a single document using the `archiveDetail` detail tag?

In AnQi CMS, displaying the full content of a single document is the foundation of website operation.Whether you are publishing a news article, a product detail, or a service introduction, the core lies in how to present the data entered in the background efficiently and accurately to the user.This is where the `archiveDetail` tag and its related mechanism come into play.

2025-11-07

How to implement navigation display between content for previous/next document tags `prevArchive`/`nextArchive`?

In website operation, providing readers with a smooth reading experience is the key to enhancing user satisfaction and website value.After a user finishes reading an exciting article or product introduction, if they can conveniently see related content such as 'Previous' or 'Next', it will undoubtedly greatly increase their time spent on the website, forming a more natural browsing path, which is very beneficial for SEO optimization and content dissemination.AnQi CMS, as a powerful content management system, fully understands this need

2025-11-07

How to implement custom attribute display and filtering for document parameter tag `archiveParams` and filter tag `archiveFilters`?

In AnQi CMS, displaying and filtering custom attributes of content is the core of implementing flexible and personalized website functions.By using the `archiveParams` and `archiveFilters` template tags, we can easily display custom content fields on the frontend and provide users with powerful functionality for filtering content based on these fields, thus greatly enhancing the website's user experience and content discoverability.### `archiveParams` Tag: Flexible Display of Custom Properties In AnQi CMS

2025-11-07