By default, the `pageDetail` tag will retrieve data for which single page?

Calendar 👁️ 71

In the powerful function system of AnQi CMS, flexibly using various tags is the key to improving efficiency for website operators and template developers. Today, we will delve into a tag that is indispensable for building static content pages -pageDetailand it focuses on itWhat single page of data will be obtained by default?This core issue.

ExplorepageDetail: How does it intelligently retrieve data?

As an experienced website operation expert, I know that every tag behind it contains the wisdom of system design.pageDetailTags, as the name implies, are specifically used for obtainingSingle PageDetails of the data. A single page usually refers to those pages with fixed and independent content, such as "About Us", "Contact Information", "Privacy Policy", and so on.

Then, by default,pageDetailWhich single page's data will the tag actually retrieve? The answer is actually very intuitive and smart:In the absence of any additional parameters specified,pageDetailThe tag automatically retrieves the data of the single page being accessed.

This is like when you are browsing a website and click on the 'About Us' navigation bar, after the page jumps, all the content you see naturally belongs to the 'About Us' single page. Anqi CMS'spageDetailThe label is designed this way. It intelligently identifies the corresponding single page based on the current page's URL path, and loads all related data to be used in the template.

For example, when you visit the URL is你的域名/about-us.html(or any URL configured as a single page) in the template file (such aspage/detail.htmlorpage/about-us.htmlIn it, you do not need to provide any ID or alias, just use the following code to get the title of the single page "About Us":

<div>单页标题:{% pageDetail with name="Title" %}</div>

The system will automatically parse the current page and return the corresponding title.This design greatly simplifies the writing of templates, allowing you to focus more on content presentation rather than cumbersome data association.

Beyond Default: Accurately locate specific single page data

Although the default behavior is very convenient, in some special scenarios, you may need to call data from specific single-page templates on non-single-page detail pages, or dynamically retrieve information from a single page through programming. At this time,pageDetailTags also provide powerful flexibility:

  1. Specify through page ID(idparameter)If you know the unique numeric ID of a single page in the Anqi CMS system, you can useidParameters to specify the data to be retrieved. For example, to get the content of10: single page content

    <div>特定单页内容:{% pageDetail with name="Content" id="10" %}</div>
    
  2. by single page URL alias(tokenparameter)In the Anqi CMS backend, you can set a custom URL for each page, also known as a URL alias or token.This is a user-friendly and easy-to-remember string, such as "about-us", "contact-us", and so on. It is usedtokenThe parameter can be retrieved more readably. For example, to get the link with aliasprivacy-policySingle page link:

    <div>隐私政策链接:{% pageDetail with name="Link" token="privacy-policy" %}</div>
    
  3. Data call in multi-site environment(siteIdparameter):For a security CMS system deployed across multiple sites, if you need to call data from a specific single-page across sites, you can usesiteIdParameters are used to specify the target site. This is usually used in large enterprises or multi-brand management scenarios. For example, to get the site ID of2of a single page title:

    <div>其他站点单页标题:{% pageDetail with name="Title" id="5" siteId="2" %}</div>
    

Application in reality: What single-page information can you obtain?

pageDetailThe fields that tags can obtain are very rich, covering all aspects of a single page, including but not limited to:

  • Id: The unique identifier ID of the single page.
  • Title: The title of the single page.
  • Link: The access link of the single page.
  • Description: The description of the single page, often used for SEO.
  • Content: The main content of a single page. Please note that if the content contains HTML tags, it may be necessary to cooperate to ensure that the browser parses it correctly.|safeFilter usage (such as {{pageContent|safe}}If the single-page content is in Markdown format, you need to addrender=trueparameters to render (such as{% pageDetail pageContent with name="Content" render=true %}{{pageContent|safe}})
  • Logo: The thumbnail or main image of the single page.
  • Thumb: The thumbnail of the single page.
  • Images: A single-page slide group image, usually an array of images, which needs to be traversed in a loop to obtain.

By flexibly combining these parameters and callable fields, you can dynamically present high-quality single-page content at any location on the website with unprecedented convenience.This intelligent data acquisition mechanism not only improves the efficiency of template development, but also lays a solid foundation for the flexible operation of website content and SEO optimization.

Frequently Asked Questions (FAQ)

  1. Question:pageDetailTags andarchiveDetailWhat are the main differences between tags?Answer: They are all used to obtain detailed data, but they are aimed at different content models.pageDetailUsed specifically to retrieve pages created in the "Page Management" sectionSingle pageData (such as "About Us", "Contact Us"), these pages are usually contentually fixed and independent. AndarchiveDetailIt is used to retrieve the content created in the "Content Management".DocumentData, such as articles, products, etc., usually belong to a certain category or model, more in number, and may contain more custom fields.

  2. Ask: If I use on a page that is not a single page (such as an article list page){% pageDetail with name="Title" %}What will happen?Answer: In this case,pageDetailThe label cannot identify which single page the current page's URL corresponds to, it will usually return an empty value or not display any content, depending on how the template handles empty values. To avoid this situation, it is recommended to always use the following method on non-single page pages.idortokenThe parameter explicitly specifies the single page to be retrieved.

  3. Question: How topageDetailDoes the tag correctly display the single page content that I input using the Markdown editor on my backend?Answer: If you enter a single-page content in the Markdown editor in the background andpageDetail with name="Content"obtain it, you need to addrender=trueparameters, and use the output result.|safeA filter to ensure that Markdown is rendered correctly into HTML and displayed safely. For example:{% pageDetail pageContent with name="Content" render=true %}{{pageContent|safe}}.

Related articles

Is the `id` parameter of the `pageDetail` tag required?

## AnQiCMS `pageDetail` tag's `id` parameter: Optional flexible art As an experienced website operations expert, I am well aware of the importance of the flexibility of content management system templates in improving operational efficiency and website performance.AnQiCMS (AnQiCMS) boasts its concise and efficient architecture, which is also reflected in the design of template tags.

2025-11-07

How to accurately obtain the details of a single page through the single page ID?

As an experienced website operations expert, I know that how to efficiently and accurately obtain the required data in a content management system is the key to improving operational efficiency.In AnQiCMS (AnQiCMS), a single page (or independent page) is often used to display 'About Us', 'Contact Information', 'Service Introduction', and other important but infrequently changing content.Sometimes, we not only need to display the details on the single page itself, but may also need to reference part of the specific page information on other parts of the website (such as the homepage, sidebar).

2025-11-07

How will the content be directly output if the `variableName` of the `pageDetail` tag is not set?

## Unlock the secrets of Anqi CMS single page content output: The power of the simple `pageDetail` tag As an expert in website operations for many years, I know that efficiently and flexibly displaying content is the key to success in daily content management.AnQiCMS (AnQiCMS) is an enterprise-level content management system developed based on the Go language, and its simple and efficient template engine is very appealing to me.It provides great convenience in content display, especially for single-page content (such as "About Us", "Contact Information", etc.)

2025-11-07

What are the respective roles of `variable name` and `field name` when calling the single-page detail?

As an experienced website operation expert, I know that understanding the essence of template tags in a high-efficiency content management system like AnQiCMS is the key to exerting its powerful functions and building flexible pages.Today, let's delve into a common problem encountered when calling single-page details: What are the respective roles of '`variable name`' and '`field name`'?In the AnQi CMS template system, the `pageDetail` tag is specifically used to call up detailed information for a single page.

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 `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

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

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