When building a website, the way content is presented is often the key to user experience and brand image.An efficient content management system should not only be able to manage content conveniently but also be able to control its display flexibly.AnQiCMS (AnQiCMS) is well-versed in this, providing users with highly personalized content display capabilities through its powerful custom template features. Whether it's articles, products, or standalone pages, they can be meticulously designed to meet your unique needs.

Custom template: a perfect blend of content and design

One of the core strengths of AnQi CMS is its clear separation of content and display logic.This means you can focus on creating high-quality content, and the visual presentation of the content can be achieved through custom templates.The system uses syntax similar to Django template engine, which is very easy for users familiar with web development to get started..htmlwith suffix, and stored集中存放在/templatein the directory, static resources (such as styles, scripts, images) have separate/public/static/Table of contents, this organization method makes the template structure clear at a glance, convenient for management and maintenance.

Through custom templates, you are no longer limited by preset layouts or styles, and can create a unique display for each type of content on the website, even for each specific content item.

Flexible and diverse content personalized display

The custom template capability of the Anqi CMS is reflected in the fine-grained control over various core contents of the website:

1. Article and Product: Deep Customization Based on Content Model

AutoCMS refers to articles and products as 'documents', all of which benefit from the system's flexible 'content model' function.You can create different content models based on your business needs, for example, a 'News Article Model' may include 'Publish Date', 'Author', while a 'Product Model' might have 'Price', 'Inventory', 'Material', 'Size', and other custom fields.

When you create or edit content, simply select the corresponding category, and the system will automatically display all fields under the content model for you to fill in. In the template, you can:

  • Specify an independent template for a single document:For example, a special download page article can specify using:download.htmlTemplate, making its layout distinct from ordinary articles. Simply fill in the template file name in the "Document Template" field when editing documents in the background.
  • Apply a unified template to the entire category:If you want all product detail pages under a specific product category to use a particular layout, you can specify a 'category template' or 'document template' when editing the category. You can also choose to 'apply to subcategories' so that all subcategory content inherits the style.
  • Flexible invocation of content data:Template tags are the bridge connecting content and design.archiveDetailLabels can retrieve detailed information of the current or specified article/product, including title, description, thumbnail, etc. Most notably, it can also be accessed byarchiveParamsLabel looping or directly byname="字段名"Call the various custom fields you define in the content model, allowing you to seamlessly integrate unique information such as 'product model', 'color options', and more into the page layout.

2. English page: Create brand story and service portal

In addition to dynamically updated articles and products, the website usually also needs fixed content pages such as 'About Us', 'Contact Us', and 'Terms of Service'.The CMS named it 'Single Page' and also gave it powerful personalized display capabilities.

  • Exclusive page template:Each single page can be specified a "single page template" when edited in the background.For example, the "About Us" page can have a unique brand introduction layout, while the "Contact Us" page can integrate maps, forms, and other specific elements.
  • Default naming and flexible coverage:Anqi CMS provides some default template naming conventions, such aspage/{单页面id}.html,If present, it will be applied automatically. But you can also specify a completely custom template filename (such aspage/about-us.html),to meet more personalized needs.
  • Data call: pageDetailLabels can conveniently obtain the title, content, images, and other information of a single page, helping you build colorful and independent pages in templates.

3. Classification and Tags: Personalized Entry for Organizing Content

Classification and tags are important organizational methods for website content. The custom templates of Anqi CMS also extend to these levels:

  • Category list differentiation display:PasscategoryListTags, you can get and display the classification list of different content models.For example, the news category page can be concise and clear, while the product category page may need to display category images or subcategory navigation, all of which can be achieved through custom templates.
  • Specific layout of tag aggregation page:When the user clicks on a label (such as "New Release" or "Special Deals"), they will be directed to a page that aggregates all related content.tagDetailandtagDataListLabels allow you to design unique templates for these aggregation pages, highlighting the characteristics of labels, and enhancing the efficiency of content discovery.

An auxiliary tool for efficient development

The template system of AnQi CMS also improves development efficiency through a series of auxiliary tags:

  • includeExtract commonly used code snippets (such as headers, footers, sidebars) into independent files and import them where needed to avoid duplication.
  • extends:Implement template inheritance, you can define a basic layout (master), and then let other page templates inherit it, and only modify specific content blocks, which greatly simplifies the template structure of large websites.
  • macro:Create reusable code functions, such as generating unified style product cards or article summaries, to improve the maintainability of templates.

Summary

The custom template function of Anqi CMS gives users absolute control over the presentation of website content.It provides not only a stable and reliable framework for content management, but more importantly, through its flexible content model, detailed template option specification, and rich template tags, it allows users to freely create unique and personalized websites based on their brand characteristics, business needs, and user experience objectives.From the overall structure of the website to every content detail, you can use the power of templates to make your content stand out in the vast sea of network information.


Common Questions (FAQ)

  1. 问:Can I apply custom templates to my articles or products without touching the code? Answer:English. You do not need to directly modify the template code file, just log in to the Anqi CMS backend, find the input box named "Document Template" or "Single Page Template" in the interface for editing specific articles, products, or pages, and enter the filename of the template you have预先 designed (for exampledownload-page.html),System will automatically apply this specified template when the content item is accessed.
  2. 问:How can I call the custom fields (such as 'Material', 'Color') that I have added to the 'Content Model' in the background in my custom template? Answer:You can use in the template of the product detail page,archiveDetailto call a tag. If your custom field name is,material, you can write directly.{% archiveDetail with name="material" %}Show its value. If you need to cycle through all custom fields, you can use{% archiveParams params %}{% for item in params %}{{ item.Name }}:{{ item.Value }}{% endfor %}{% endarchiveParams %}.
  3. Question: If I set a 'Category Template' for a category, will it affect all subcategories under it? Answer:By default, the "category template" set will only affect the display of the list page for the current category and will not automatically inherit to its subcategories. However, when editing a category, you can check