When building a website with AnQiCMS, the display of single-page content and page list is an indispensable component.Whether it is an independent content page like "About Us" or a series of links in the website footer navigation, they all need a flexible and efficient way to manage and display.In AnQiCMS,pageDetailandpageListThese tags are powerful tools designed to meet these needs.They each focus on different application scenarios, but also cooperate with each other to build a rich and orderly single-page content system on the website.
pageDetailLabel: Fine craftsmanship, presenting exclusive content
When we need to fully display the detailed content of an independent page on a page.pageDetailThe label comes in handy. Its core function is to retrieve all the details of a specified single page, such as the title, links, page description, complete page content, even the thumbnail image or multiple slide sets configured on the page.
UsepageDetailTags usually have two main ways to locate the page content you want. You can specify it precisely by the unique ID of the page, for example{% pageDetail with name="Title" id="1" %}If you prefer to use meaningful text identifiers, you can also refer to the page's URL alias (i.e., token), for example{% pageDetail with name="Content" token="about-us" %}Of course, if you are in a single page corresponding template file (such aspage/detail.htmlorpage/{单页ID}.html), you usually do not need to specify an ID or token,pageDetailThe label will intelligently retrieve information from the current page.
BypageDetailWe can easily call the carefully edited data from the background "Page Management" in the front-end template. For example, the "About Us" page of a website usually contains company profiles, development histories, and other rich text. These contents are through the background editing completed, by{% pageDetail with name="Content" %}Can be fully displayed on the front end. Similarly, if you configure a beautiful Banner image for the single page, you can also access and display it, adding visual appeal to the page.{% pageDetail pageImages with name="Images" %}to retrieve and display it, adding visual appeal to the page.
pageListLabel: flexible organization, building convenient navigation and index
withpageDetailFocuses on the details of a single page display, different, pageListThe tag focuses on obtaining a collection of single pages. Its main application scenarios are situations where multiple single-page links or brief information need to be listed, such as the navigation menu of a website, the bottom friend link area, or the 'Hot Single Page' recommendation in the sidebar.
pageListThe tag is very concise in use, usually no additional parameters are required, it will default to retrieving all single-page lists created.Once we get the list of pages, we can traverse them in a loop to sequentially extract the title, link, brief description, and thumbnail information of each page.
For example, in the footer of the website, you may need to list multiple single-page links such as "Privacy Policy", "Terms of Service", "Legal Statement", etc., at this pointpageListIt can be put to good use. With a simple loop, these links can be presented uniformly, saving the trouble of manually adding each link.
Furthermore,pageListAlthough it is default to get all pages, in practice, we often need to filter the list. AnQiCMS provides inforThe flexibility to perform conditional judgments within loops, for example, you can exclude a specific ID page in the loop, or only display pages that meet certain conditions, thereby achieving a more refined list display.
Collaboration: Boosting single-page content management like a tiger
pageDetailandpageListThese tags are the core capabilities provided by AnQiCMS in single-page content management.They jointly赋予网站powerful content organization and display flexibility.By using the "Page Management" feature on the backend, we can conveniently create, edit, and manage various single-page content, andpageDetailandpageListThey are responsible for presenting these background data efficiently and beautifully to the users.Whether it is to build a rich independent page or design a clear and convenient page navigation, these tags are indispensable tools that make the operation of single-page content simple and efficient.
Frequently Asked Questions (FAQ):
How do I specify
pageDetailTags to get the specific single-page content I want?Generally,pageDetailThe tag automatically retrieves information from the current page. But if you want to get the content of other specified pages, you can use the page ID (for exampleid="5") or the URL alias set in the background (token="about-us"Specify as a parameter.pageListThe tag has retrieved all single pages of the website, but I only want to display a few at a certain location. How do I do that?pageListCertainly, it will retrieve all single-page lists. You can usepageListWhen looping through tags on a page, you can add conditional judgments inside the loop to filter. For example, you can judgeitem.IdIs it the page ID you want to exclude or the judgmentitem.TitleWhether it contains specific keywords to only display pages that meet your needs.Does the content written in a single page support Markdown format? If it supports, it is on the front end
pageDetailHow to correctly render the tag after obtaining it?Yes, AnQiCMS single-page content supports Markdown format. After you turn on the Markdown editor in the background and write content using Markdown syntax,pageDetailTagging for obtainingContentThe field is automatically converted to HTML during frontend rendering. If you need to control the rendering process more precisely, you can also inpageDetaila tag toContentadd a fieldrender=trueorrender=falseThe parameter manually decides whether to perform Markdown to HTML conversion.