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 classification templates is not a one-size-fits-all solution, it follows a step-by-step, hierarchical coverage logic.From the global default template, to the category list under the content model, to the exclusive template of a specific category, and finally to the independent display of a single document, AnQiCMS provides a comprehensive customization system to ensure that we can present the most appropriate visual experience and information structure to users based on different content attributes and marketing strategies.
Core Concept: Model-driven and Flexible Coverage
The core of AnQiCMS lies in its "content model"-driven architecture.Every content, whether it is an article, product, or other custom type, belongs to a specific content model.This model not only defines the structure of the content fields, but also provides the basic path for the organization of the template.On this basis, AnQiCMS allows us to customize and override templates at multiple levels, with the priority from low to high as: Global default template -> Content model default template -> Category list template -> Unified template for documents under categories -> Independent template for single document.This design gives operators great freedom, allowing for fine-grained control according to specific needs.
Level one: Site-level and model default template
In the AnQiCMS template system, the first is the default template at the site level. Each template package has a preset structure, such as the list page is usually set to default as{模型table}/list.html, and the document detail page is set to{模型table}/detail.html. Here,{模型table}Represented the name of the content model (for examplearticleRepresents the article model,productRepresented the product model). This means that all content belonging to the "article" model will default to use if not specified otherwisearticle/list.htmlAs a list template,article/detail.htmlAs a detail template. Similarly, the "product" model will use the defaultproduct/list.htmlandproduct/detail.html. This default mechanism ensures the basic display consistency of the website across different content types.
Level two: Custom list template for category exclusive
Further customization is reflected in the template settings of the specific category list page.When you want the content list of a certain category to have a unique layout or style, AnQiCMS provides two implementation methods.One is throughNaming conventionsFor example, if you have a category with ID 100 under an article model, you can create it in the template filearticle/list-100.html. The AnQiCMS system will automatically recognize and apply this template as the exclusive list page for this category. Another way is toManage categories in the background interfaceManually specify. When editing the category, find the "Category Template" field, where you can enter a custom template filename (such asspecial_article_list.html), as long as the template file exists in your template package, the system will use it first.
It is worth noting that there is also an option for '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 subcategories, thus simplifying the bulk setting work.
Level three: unified template under the category document.
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 certain scenarios, for example, all product details under a certain product series need to follow a unified display style, or all articles under a special theme need to use specially designed layouts. InManage categories in the background interfaceIt will also have a 'document template' field. Here you fill in a template filename (for exampleproduct_details_fancy.htmlThen this category and all documents in the subcategories (if inheritance is enabled) will use this template for rendering when accessed, rather than the default detail template of the model.This provides strong support for maintaining the unity of certain types of content.
Level four: Custom template for a single document
The highest priority template customization rights belong to a single document. In content operations, 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.at AnQiCMS'sDocument editing pageBy means of the "Other Parameters" field, you can directly specify a template file name (such asmy_unique_article.htmlThis setting will unconditionally override all lower-level template settings, ensuring that the document can be presented in its most unique way.
Special case: flexible application of single-page templates.
For "single-page" content (such as "About Us", "Contact Information", etc.), AnQiCMS also provides a similar template customization mechanism. By default, single pages will usepage/detail.htmltemplate. But like document classification, you can go throughNaming conventionsfor examplepage/about.htmlfor the "About Us" page, or evensingle-page admin backgroundSpecify a template in the "Single Page Template" field to achieve personalized display of a single page.This enables the design of static content pages to be flexible and varied, meeting the special needs of brand building.
adaption strategy for mobile template
In addition to the above template levels for content types, AnQiCMS also supports independent adaptation of mobile templates. By creating in the root directory of the templatemobileSubdirectory, and copy and modify the structure and files of the PC template, AnQiCMS can automatically call when detecting that the user is accessing through a mobile devicemobileThis means that regardless of how the PC end sets the category or document template, the mobile end can have its own completely independent template system to optimize the user experience.
Summary and Practical Suggestions
The template category setting function of AnQiCMS 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 unique user experiences for specific categories or topics, to creating exclusive visual presentations for individual key content.
In practice, I suggest you:
- Planning comes first:Before starting content creation and template design, be clear about the display requirements of various contents and plan the hierarchical structure of the template.
- Make good use of naming conventions:For content with many categories and structured, using naming conventions (such as
{模型table}/list-{分类id}.html) can improve efficiency and maintain tidiness. - Note the priority:Remember that the "most specific" settings have the highest priority, meaning that the template settings for a single document will override the category settings, and category settings will override the model default settings.
- Thorough testing:After adjusting the template settings, be sure to thoroughly test on different devices and browsers to ensure the display meets expectations.
By using the powerful template customization capabilities of AnQi CMS, we can present content to target users more efficiently and accurately, thus enhancing user experience and promoting the overall operational effect of the website.
Frequently Asked Questions (FAQ)
Ask: If I set an independent template for a document and the category it belongs to also has a document template set, which template will be used in the end?Answer: In this case, the independent template settings of a single document have the highest priority.The design logic of AnQiCMS is that the most specific settings will override the more general settings.Therefore, this document will use its own specified independent template, rather than the unified document template set by its category.
Ask: Can I set different templates for the list page of the same category and the document detail page under the category?Answer: Absolutely. 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 separately in the category management (affecting the display of the content list of this category), as well as the default detail template for all documents under this category (affecting the independent page display of all documents within this category).
Ask: Will the settings of the mobile template affect the PC template? How do they work together?Answer: The mobile template and PC template are completely independent systems, they will not affect each other. When users access the website using mobile devices, AnQiCMS will prioritize detectionmobileThe corresponding template under the directory, if it exists, then use the mobile template;If not available, it may revert 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.