As a senior website operation expert, I am well aware that fully understanding the details of template tags in an efficient content management system like AnQiCMS is the key to refined operation and content display. Today, let's delve into the topic deep.pageListLabel, this is an important tool for obtaining a single-page list, as well as each single-page object it returns (item) which contains what core fields and their operating value.

Anqi CMS'spageListTags are instructions we commonly use when constructing relatively fixed, infrequently updated independent pages such as 'About Us', 'Contact Information', and 'Service Introduction'.It allows us to batch retrieve the data of these single pages, thus enabling flexible reference in navigation, sidebar, or specific content blocks.{% pageList pages %}to iteratepagesWhen collecting, each loop generates aitemobject, thisitemis the specific information collection of the current page being traversed.

UnderstandingitemThe core fields contained in the object are like a universal key, which can help us design page structures more accurately, optimize user experience, and even play an important role in SEO.

Unique Identity and Access Path: Id, Title and Link

Firstly, each single-page object has its most basic and most important identifier and access method:

  • Id (single-page ID): This is the unique identifier for each single page in the system, just like our ID number. When managing on the backend or performing more advanced template logic judgments,IdIt can ensure that we accurately locate and operate specific single pages. Although it is not often directly displayed in the front-end pages, it is the cornerstone of background logic and data association.
  • Title (单页标题)This is the most intuitive name for a single-page application, and it is the first piece of information perceived by users on the website.An clear, attractive title not only enhances user experience, but is also one of the core elements of Search Engine Optimization (SEO).<title>Tag) as well as other places that need an overview.TitleAll play a crucial role.
  • Link (单页链接)This is the URL address for accessing this single page. Whether it is generating navigation links, article recommendations, or any redirection,LinkAll fields provide direct paths to the target pages. A well-planned link structure has a direct impact on the overall navigation logic of the website and the efficiency of search engine crawling.

These fields collectively constitute the basic "business card" information of a single page, ensuring the page's recognition and accessibility.

Overview and detailed presentation: Description and Content

In addition to basic information,itemthe object also carries descriptive and completeness information about the page content:

  • Description (English):This field usually stores a brief overview or summary of the single page. When displayed in a list,DescriptionThe content can provide a quick preview for users, helping them decide whether to click into the detail page.At the same time, it is also an important source of the Meta Description tag in SEO, which directly affects the click-through rate of the page in search results.A refined and attractive description can often improve the visibility and conversion rate of the page.
  • Content (单页内容):这是单页面的主体内容,包含了我们为该页面精心撰写的所有文本、图片、格式化信息等。虽然在EnglishpageListIn the loop, the complete content is displayed directlyContentNot common, as it is usually very long, but in certain special layouts, such as when part of the content needs to be extracted as a dynamic preview, or when embedded display is allowed in the content model, this field becomes indispensable. It ensures thatitemThe object can carry all the core information of the page.

These two fields collectively support the expression of content on a single page, from overview to details, progressing layer by layer.

Visual Attractiveness: Logo, Thumb and Images

In this era of 'face value', the visual presentation of a page is equally important.itemThe object also provides rich image information:

  • Logo (thumbnail large image of a single page)This field usually points to the main image of the page or a larger representative image.It may be used for the page header banner, prominent display of content modules, or as a preview image when shared on social media.The positioning of the 'large image' makes it more suitable for use in scenes with ample space and a strong visual impact.
  • Thumb (thumbnail of a single page):ThumbYesLogoThe 'mini version', pointing to the page thumbnail.It is more suitable for use in compact lists, card layouts, recommendation spots, or small-sized preview images to save page loading resources and maintain a neat layout.Thumbfield.
  • Images (slideshow group image of a single page)If a single page needs to display a photo gallery, a multi-angle view of products, or a series of carousels,ImagesThe field provides such capabilities. It is usually an array or collection of image URLs, which makes it convenient for us to loop through them in templates and provide users with a richer visual experience.

These image-related fields allow the display of a single page not to be limited to text, but to quickly attract the user's attention through visual elements, enhancing the aesthetics and interactivity of the page.

MasteredpageListTag returnsitemWith the meaning and usage of these core fields in the object, we can carry out website content layout more skillfully, creating a beautiful and practical Anqi CMS site. In actual operation, it is only necessary to iterate through the template using a looppagesCollection, so you can access eachitemThese properties, such as{{item.Title}}/{{item.Link}}And so on, thus dynamically presenting these data in all corners of the website.


Common Questions (FAQ)

  1. pageListReturns a single-page objectitemDoes it contain the fields we added by ourselves?In most cases,pageListreturneditemThe object will include the core fields set by default in the background. If your single page has extended additional information through custom fields, these custom fields inpageDetailcan be directly accessed through the tagname="您的自定义字段名"The way to access. InpageListreturneditemobject, these custom fields are usually also included, and you can access them through{{item.您的自定义字段名}}The way to try to access. If you encounter a situation where it cannot be accessed directly, it is recommended to consult the latest template development document of AnQiCMS or seek support in the community to determine itspageListThe specific access method in the loop.

  2. item.Logoanditem.ThumbWhat is the difference between these two fields, and how should we choose to use them?Literally speaking,Logo(Thumbnail Large Image) Usually refers to the main visual image or a larger-sized representative image on a page, suitable for display in key positions such as the top of the page or large-sized cards to provide a clear visual effect.ThumbEnglish translation: The thumbnail version is more compact and suitable for lists, sidebars, or any scenario where space is saved and fast loading is required. When choosing, you can decide based on the size of the page area and the clarity of the image required, and it is usually preferable to use it when displaying lists.ThumbAnd while showing details or large imagesLogo.

  3. If I only want to display in the listitem.Contentof the content instead of all, how should I operate?Whenitem.ContentWhen the field content is too long, it will directly affect the layout and user experience of the list. The template engine of Anqi CMS provides a filter to handle this situation. You can usetruncatecharsortruncatewordsFilter to truncate content and add an ellipsis. For example,{{ item.Content|truncatechars:100 }}it will truncate the first 100 characters (including the ellipsis), and{{ item.Content|truncatewords:20 }}It will extract the first 20 words. Both filters can help you display content summaries elegantly while maintaining the integrity of the content.