`pageDetail` tag can call which detailed information of a single page (such as ID, title, content)?

Calendar 👁️ 52

As a senior security CMS website operations personnel, I know that efficient content management is crucial for the success of the website.The single page is an important part of the website architecture, carrying core static information such as "About Us", "Contact Information", and "Terms of Service".The Anqi CMS provides powerfulpageDetailTags, allowing operators to flexibly call and display various detailed information on a single page.

pageDetailThe tag is a data call tool specially designed for single-page content in AnQi CMS template engine.It allows template developers and operators to accurately obtain detailed data for a specific single page and render it on the website's frontend.Whether it is the core text that needs to be displayed on the page, or the associated image resources,pageDetailAll of them provide convenient access methods.

The basic syntax of this tag is{% pageDetail variableName with name="fieldName" id="1" %}. Here,variableNameIs an optional variable name, you can specify it as an alias for convenience when referencing the data obtained in the template.nameParameters are used to specify the specific information field you want to retrieve from a single page. In addition,pageDetailThe tag also supports passing throughidParameter is used to specify the ID of the single page to be retrieved, or bytokenParameters are used to reference the URL alias of a single page. If neither of these parameters is explicitly specified, the tag will default to attempting to retrieve the single-page details corresponding to the current page.For operators managing multiple sites,siteIdParameters can allow them to easily call single-page data from other sites.

pageDetailThe tag can call up a very comprehensive single-page detail page, covering all aspects from basic identification to rich text content and multimedia resources, ensuring the flexibility and richness of single-page display.

First, each single page has a unique identifier, namelyId. This is the core field used internally by the system to identify and manage single pages. Following it isTitleIt represents the main title of a single page, which is usually the first text that users see on the page. The access path of the page is throughLinkThe field provides, this field will dynamically generate a complete URL pointing to the single page.

To better support search engine optimization and provide user overview,DescriptionThe field provides a brief description of the page, which is usually used in HTML meta tags or as a summary display of page content. The core content of a single page is stored inContentIn the field. This field supports rich text editing, including text, images, videos, etc. It is worth noting that if the Markdown editor is enabled on the back end, ContentThe field will automatically convert Markdown syntax to HTML by default; if you need finer control, for example, to disable Markdown conversion, you can do so through the template.renderParameters (set totrueorfalse) for explicit specification.

In terms of visual presentation,pageDetailtags also provide a variety of options.LogoThe field usually stores the URL of a large thumbnail or main visual image for a single page and it is used forThumbThe field provides a standard thumbnail image URL, commonly used on list pages or for small displays. If a single page needs to display a gallery or carousel of images,ImagesThe field will return an array of image URLs, and the template can iterate over this array to display multiple images.

Here are some specific template code examples that demonstrate how to call these details:

To obtain the unique identifier of a single page:<div>单页ID:{% pageDetail with name="Id" %}</div>

To get the title information of a single page:<div>单页标题:{% pageDetail with name="Title" %}</div>

Retrieve the URL link of a single page:<div>单页链接:{% pageDetail with name="Link" %}</div>

Retrieve the descriptive content of a single page:<div>单页描述:{% pageDetail with name="Description" %}</div>

Get the main content of a single page and ensure safe HTML rendering. If Markdown rendering is needed, it can be addedrender=true:<div>单页内容:{% pageDetail pageContent with name="Content" render=true %}{{pageContent|safe}}</div>

Get the large thumbnail of a single page:<div>缩略图大图:<img src="{% pageDetail with name="Logo" %}" alt="{% pageDetail with name="Title" %}" /></div>

Get the standard thumbnail of a single page:<div>缩略图大图:<img src="{% pageDetail with name="Thumb" %}" alt="{% pageDetail with name="Title" %}" /></div>

When a single page contains multiple images, you can use a loopImagesto display the field:{% pageDetail pageImages with name="Images" %} <ul> {% for item in pageImages %} <li> <img src="{{item}}" alt="{% pageDetail with name="Title" %}" /> </li> {% endfor %} </ul>

Through these rich fields, Anqi CMS'spageDetailThe label provides powerful content display capabilities for website operators.It simplifies the call logic of single-page content, allowing even complex static page layouts to be implemented through concise template code, thereby improving the efficiency and flexibility of website content management.


Frequently Asked Questions (FAQ)

  • Can you use tags to call single-page data from other sites in a multi-site management environment?pageDetailTags can call single-page data from other sites in a multi-site management environment?Can.pageDetailTag supportsiteIdParameter. If you have configured multiple sites in the Anqi CMS backend and want to call single-page data from other sites on the current site, just specify it in the tagsiteId="目标站点ID"The system will then fetch the single-page details from the specified site. This is very useful for cross-site content sharing or unified management.

  • ContentDoes the field default to Markdown conversion, and how can I only display raw HTML or plain text? ContentThe behavior of the field depends on whether Markdown editor is enabled in the backend content settings.If enabled, it will attempt to convert Markdown to HTML.If you want to ensure that the content is displayed as pure HTML or plain text without Markdown conversion, you canpageDetaila tag toContentadd a fieldrender=falseparameters, for example{% pageDetail pageContent with name="Content" render=false %}{{pageContent|safe}}Meanwhile, to prevent HTML code from being automatically escaped by the browser and displayed as code instead of style, you must use|safefilter.

  • If you are usingpageDetailtag, no explicit specification has been madeidortokenWhat will happen with the parameter?WhenpageDetailNo tag providedidortokenWhen a parameter is specified, it will intelligently match and attempt to retrieve the details of the single-page view currently being browsed based on the current page URL path.This design makes it very convenient to create universal single-page templates, you do not need to manually specify IDs or aliases for each single page, the template can automatically display the content of the current page.

Related articles

What happens if the specified single-page template file does not exist?

In AnQi CMS, the single-page template file plays a crucial role, responsible for defining the layout and style of independent pages such as 'About Us' and 'Contact Information'.Website operators usually specify specific template files for these single pages according to business needs to achieve personalized content display.However, if the specified single-page template file does not exist, it will directly affect the normal access and user experience of the page.

2025-11-06

How to specify an independent template file for a single page?

As a senior CMS website operation personnel in an enterprise, I know that the flexibility of content display is crucial for attracting and retaining users.The AnQi CMS provides powerful template customization capabilities, allowing us to specify independent template files for different page features, thereby achieving personalized content layout and design.This is particularly important for creating unique single-page websites, such as 'About Us', 'Contact Information', or specific event landing pages.Understanding AnQi CMS template mechanism All template files in AnQi CMS are stored uniformly in

2025-11-06

Does the single-page content support Markdown format editing?

As a professional deeply familiar with the operation of Anqi CMS, I am very willing to give you a detailed explanation of the support for Markdown format editing in the single-page content of Anqi CMS.The Anqi CMS is committed to providing users with an efficient and flexible content management solution.In terms of content editing, the system provides a richly featured rich text editor, covering a variety of common editing functions such as title settings, text styles (such as bold, italic, underline, strikethrough), lists, alignment, as well as the insertion of images, videos, tables, and code blocks.

2025-11-06

How to adjust the display order of single pages through the background settings?

AnQi CMS is an efficient content management system that provides flexible and powerful content management tools for website operators.In daily operation, the display order of single pages (such as "About Us", "Contact Information", "Service Introduction", etc.) directly affects the efficiency of users obtaining website information and the overall browsing experience.Understand how to adjust the display order of these single pages on the AnQiCMS backend, which is a key step in optimizing the website structure and user process.AnQiCMS provides an intuitive backend setting item, allowing you to easily control the display priority of a single page in the list

2025-11-06

How to retrieve the list of all single pages using the `pageList` tag and display it on the front end?

As a senior person who is deeply familiar with AnQiCMS (AnQiCMS) operation, I know that content is the core position in website construction.The single page acts as the cornerstone for carrying corporate core information, service introduction, contact information, and other static content. Its effective display is crucial for users to understand the website and the corporate image.This article will elaborate on how to use the built-in `pageList` tag of AnQiCMS to retrieve and flexibly display all single page content on the frontend.### Master the `pageList` tag to build a clear single-page navigation and display In AnQiCMS

2025-11-06

How to determine if a single page exists in the template and display its content?

As an experienced security CMS website operator, I know that it is crucial to flexibly control the display of content in template development, especially for single-page content such as "About Us" and "Contact Us" that may require dynamic judgment and display.In actual operation, we often need to decide whether to render a block or link based on the existence of the page to ensure the accuracy of the website content and the user experience.Below, I will elaborate on how to determine if a single page exists in the Anqi CMS template and display its content.###

2025-11-06

How to use the lazy loading feature of images in single page content?

As an experienced AnQiCMS website operator, I know the importance of website performance for user experience and SEO.Lazy loading of images is an essential optimization method to improve website loading speed, especially on single-page content that contains a large number of images.AnQiCMS provides good support for lazy loading of images at the content rendering level, allowing us to implement this feature through simple template configuration combined with front-end technology. I will elaborate in detail on how to implement lazy loading of images in the single-page content of AnQiCMS.

2025-11-06

How to obtain the SEO title and description of a single page through template tags?

As an experienced security CMS website operator, I am well aware of the key role that each page plays in search engine optimization, especially the SEO title and description.They are not only the first line of defense to attract users to click, but also an important signal to convey the core content of the page to search engines.AnQi CMS is well-versed in this, providing us with powerful and flexible template tags, allowing us to precisely control the SEO elements of each single page.

2025-11-06