In the daily operation and template design of AnQiCMS, we often encounter questions about the flexibility of content display. One very specific and frequently mentioned question is:pages.Pagesin an array.NameField can be customized to display other text besides numbers?As an experienced website operations expert, I will combine the features and content operation strategies of AnQiCMS to deeply analyze this issue for you.


Translate AnQiCMS pagination page number:pages.Pagesin an array.NameCan field display text be customized?

When we discusspages.Pagesin an array.NameWhen defining a field, it is first necessary to clarify its context - this is usually referring to the AnQiCMS template, which is used to build pagination navigation.paginationThe data structure returned by the tag.tag-pagination.mdIn the document, we can seepaginationTag returnspagesthe object containsPagesthis middle page number array, and each element of this arrayitem(i.e.,)pageItem) hasName/LinkandIsCurrentthree fields.

To put it directly, forpages.PagesThe one representing a specific page number in theNamefield, AnQiCMSThe feature to directly customize the display text as non-numeric is not provided yetThis means, you cannot directly modify the page numbers “1”, “2”, “3”, etc. in the pagination navigation to “First Page”, “Next Page”, or any other custom text.

From the design philosophy of AnQiCMS, such a setting is reasonable.AnQiCMS as an enterprise-level content management system, its functional design focuses on efficiency, maintainability, and consistency of user experience.The page number in pagination navigation, which plays a core role in clearly indicating the current page position and the index of pages that can be navigated to in English.Using numbers as page name is a globally universal, most intuitive, and lowest cost of recognition display method.

For example, intag-pagination.mdThe example code shows that the middle page number part is rendered through{% for item in pages.Pages %}<a class="{% if item.IsCurrent %}active{% endif %}" href="{{item.Link}}">{{item.Name}}</a>{% endfor %}such a structure. Here,{{item.Name}}This will directly output the corresponding number on the page (such as 1, 2, 3, etc.), which is automatically generated internally based on the pagination logic. No interface is provided for external customization of its text.

However, this does not mean that all the text of pagination navigation cannot be customized.paginationTag returnsFirstPage(Home page),LastPage(Last page),PrevPage(Previous page) andNextPage(Next page) and other special pagination links, theirName字段在默认情况下会显示“首页”、“末页”等描述性文本。这些文本通常可以通过AnQiCMS内置的多语言包(如AnQiCMS 项目优势.mdMentioned in the "multi-language support" andhelp-setting-system.mdto switch between the "default language package") to adapt to the needs of websites in different language environments. For example,tag-tr.mdEnglish translation tag introduced in the description, which can be used in the template to implement translation of fixed descriptive text, but not for custom modification of page numbers.

It is worth noting that AnQiCMS demonstrates high flexibility in customizing other 'Name' or 'Title' fields. For example:

  • Single Page Management(help-source-page.md):You can set custom 'Page Title' and 'Custom URL' for single pages such as 'About Us' and 'Contact Us' in the background to meet personalized content display and SEO requirements.
  • Document Category(help-content-category.md):The “category name” can also be freely set, and a “custom URL” can be set for the category.
  • Content Model(help-content-module.md):The model allows you to define various field "parameter names", which are highly controllable display text.

Therefore, when we mention 'Can the 'Name' field be customized' in AnQiCMS, we need to distinguish which 'Name' we are referring to: if it refers to the number representing the page number in the pagination navigationNameThe field, then the answer is that it does not support direct customization to other display text; but if it refers to other page content, categories, tags, or URL aliases, AnQiCMS provides rich customization options.This design ensures the stability and consistency of core functions (such as pagination) while also considering the flexibility of content management in other aspects.


Common Questions (FAQ)

  1. 问:In AnQiCMS, besides the pagination page number, are there any other places where the 'Name' or 'Title' can be customized to display text? Answer:AnQiCMS provides high-level text customization capabilities in many content aspects.For example, in 'Page Management', you can set the 'Page Name' for each single page; in 'Document Category', you can customize the 'Category Name'; in 'Document Tag', you can specify the 'Tag Name'; even in 'Content Model', you can define the 'Parameter Name' for custom fields.These fields can be flexibly set to any display text according to your operational needs.

  2. 问:If I want the text of 'Home', 'Previous Page', 'Next Page', and other navigation text in pagination to be displayed in other languages, does AnQiCMS support this? Answer:Yes, AnQiCMS supports multilingual functionality.These descriptive pagination navigation texts, such as 'Home', 'Previous Page', etc., are usually integrated into the built-in language package of the system.{% tr "yourLocation" %}),来实现这些固定文本在不同语言环境下的自动切换显示。This is to achieve the automatic switching of fixed text in different language environments. It is different from directly customizing the page number, as it is more based on system-level multilingual localization.

  3. 问:我能否自定义分页链接的URL结构,使其包含除数字以外的别名或路径? Answer:AnQiCMS允许您通过“伪静态规则”(English)help-plugin-rewrite.md)to highly customize the website URL structure. In the custom mode, you can define a URL structure that includes document lists, model homepages, and other elements{page}(page number)、{filename}(custom link name)、{module}The rules for variables such as (model table name). This means you can design SEO-friendly pagination URLs, such as/{module}-{filename}-{page}.html, but here the{page}It will still be parsed as a number, you cannot replace it with custom display text. This is customization for URL structure rather than the display text of pagination page numbers.