As a professional who deeply understands the operation of AnQiCMS and has a profound understanding of website content operation, I know that refined content display is the key to attracting and retaining users.The flexibility of AnQiCMS in template management, especially the ability to set independent templates for document classification, is an important tool for us to achieve this goal.
In AnQiCMS, the setting of content category templates is not a one-size-fits-all approach; it follows a logical progression of step-by-step and hierarchical coverage.From the global default template, to the category list under the content model, to the exclusive template for a specific category, and finally to the independent display of a single document, AnQiCMS provides a complete customization system to ensure that we can present the most appropriate visual experience and information structure according to different content attributes and marketing strategies.
Core Concept: Model-driven and Flexible Coverage
层级一:站点级与模型默认模板 (English)
In the AnQiCMS template system, the first is the default template at the site level. Each template package has its preset structure, for example, the list page is usually set to default as{模型table}/list.htmlThe document detail page is set to{模型table}/detail.htmlHere,{模型table}represented the name of the content model (e.g.,articleRepresents the article model,productrepresents the product model). This means that all content belonging to the "article" model will default to usingarticle/list.htmlAs a list template,article/detail.htmlAs a detail template. Similarly, the "product" model will default to usingproduct/list.htmlandproduct/detail.html. This default mechanism ensures the basic display consistency of the website across different content types.
Level two: Customization of category-specific list templates
An even further customization is reflected in the template settings for specific category list pages.When you want the content list under a certain category to have a unique layout or style, AnQiCMS provides two implementation methods.Naming conventionsFor example, if you have a category with ID 100 under an article model, you can create in the template filearticle/list-100.html。AnQiCMS system will automatically identify and apply this template as the exclusive list page for this category. Another way is to go tothe background category management interfacePerform manual specification. When editing categories, locate the "Category Template" field, where you can enter a custom template filename (for examplespecial_article_list.html),Only if the template file exists in your template package, the system will use it first.
It is worth noting that there is also an option called 'Apply to subcategories' in the category settings.If you check this option, the list template set for the current category will be inherited by all its subordinate subcategories, thereby simplifying the batch setting work.
Level three: Uniform template for documents under categories
In addition to the category list page, AnQiCMS also allows you to specify a detail template for all documents under a specific category.This is very useful in some scenarios, such as when all product details under a certain product series need to follow a unified display style, or when all articles under a special theme need to use a specially designed layout.the background category management interfaceIn, there will also be a "Document Template" field. Here, enter a template file name (for exampleproduct_details_fancy.html),then all documents under this category and its (if inheritance is enabled) child categories will use this template for rendering when accessed, instead of the default detail template of the model.This provides strong support for maintaining the consistency of certain types of content.
Level four: Custom template for a single document
Highest priority template customization rights belong to the single document.In content operation, we occasionally encounter situations where we need to design a unique display template for a specific article or product detail page, such as a special marketing landing page or a detailed product introduction page.Document editing pageThrough the 'Other Parameters' section, you can directly specify a template filename (such asmy_unique_article.htmlThis setting will unconditionally override all lower-level template settings to ensure that the document can be presented in its most unique way.
Special case: flexible application of single-page templates
For the "single-page" content (such as "About Uspage/detail.htmlTemplate. But like document classification, you canNaming conventions[for example]page/about.htmlfor the "About Us" page), orSingle-page management backendSpecify a template in the "Single Page Template" field to implement the personalized display of a single page.This makes the design of static content pages flexible and diverse, meeting the special needs of brand building.
Adaptation strategy for mobile template
English for auto is English, through in template root directory.mobileSubdirectory, and copy and modify the structure and files of the PC template, AnQiCMS will automatically call when detecting that the user is accessing through a mobile devicemobileThe corresponding template under the directory. This means that regardless of how the classification or document template is set on the PC end, the mobile end can have its own completely independent template system to optimize the user experience.
Summary and practical suggestions
AnQiCMS's template category setting function provides unparalleled fine control for website operators.By flexibly using these hierarchical template settings, we can easily meet various content display needs: from maintaining a unified site style, to creating a unique user experience for specific categories or themes, to crafting a dedicated visual presentation for individual key content.
In practice, I recommend that you:
- Plan first:Before starting content creation and template design, be clear about the display requirements of various types of content, and plan the hierarchical structure of the template.
- Make good use of naming conventions:For content that is categorized extensively and structured, utilizing naming conventions (such as
{模型table}/list-{分类id}.html) can improve efficiency and maintain neatness. - Pay attention to priority:Remember that the "most specific" settings have the highest priority, i.e., the template settings of a single document will override the category settings, and the category settings will override the model default settings.
- Sufficient testing:Always perform thorough testing on different devices and browsers after adjusting the template settings to ensure the display meets expectations.
Through the powerful template customization capabilities of Safe CMS, we can present content to target users more efficiently and accurately, thus improving user experience and promoting the overall operation effect of the website.
Common Questions and Answers (FAQ)
问:If I set a separate template for a document and the category it belongs to also has a document template set, which template will be used in the end?答:In this case, the independent template setting of a single document has the highest priority.The design logic of AnQiCMS is the most specific settings overriding the more general settings.Therefore, this document will use its own specified independent template instead of the document template set uniformly for its category.
问:Can I set different templates for the list page of the same category and the document detail page under the category?答:完全可以。AnQiCMS treats the "Category List Page Template" and the "Document Detail Page Template under Category" as two different template settings.You can specify the list page template (affecting the display of the content list of this category) and the default detail template for all documents under this category (affecting the independent page display of all documents within this category) in the category management.
问:How does the mobile template setting affect the PC template? How do they work together?答:The mobile template and PC template are completely independent systems, they will not affect each other. When a user accesses the website using a mobile device, AnQiCMS will prioritize detectingmobileThe corresponding template under the directory, if it exists, will use the mobile template; if it does not exist, it may fall back to the PC template (the specific behavior depends on your AnQiCMS version and configuration).This means you can provide a fully optimized experience for mobile users without worrying about interfering with the presentation of the PC website.