When building a website, the way content is presented is often the key to user experience and brand image.A high-efficiency content management system must not only be able to manage content conveniently but also be able to flexibly control its display.AnQiCMS (AnQiCMS) is well-versed in this, providing users with highly personalized content display capabilities through its powerful custom template features, meticulously designed to meet your unique needs, whether it's articles, products, or standalone pages.
Custom template: the perfect fusion of content and design
One of the core advantages of AnQi CMS lies in 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 a syntax similar to the Django template engine, which is very easy to get started with for users familiar with web development.All template files are.htmlWith the suffix, and stored centrally in/templateThe directory, static resources (such as styles, scripts, images) have separate ones/public/static/The directory, this organizational method makes the template structure clear at a glance, convenient for management and maintenance.
By customizing the template, you are no longer limited by preset layouts or styles, and can create exclusive display forms for every type of content on the website, even for specific content items.
Flexible and diverse content personalized display
The custom template capability of 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
AnQi CMS refers to articles and products as "documents", all of which benefit from the flexible "content model" function of the system.You can create different content models according to your business needs, for example, a 'news article model' may include 'publish date', 'author', while a 'product model' may have 'price', 'inventory', 'material', 'size', and other custom fields.
When you create or edit content, just select the corresponding category, and the system will automatically display all fields under the content model for you to fill in. And in the template, you can:
- Specify an independent template for a single document:For example, an article on a special download page can be specified for use
download.htmlThe template makes the layout different from ordinary articles. Just enter the template file name in the "Document Template" field when editing documents in the background. - Apply a uniform template to the entire category:If you want all product detail pages under a certain product category to use a specific layout, you can specify a 'category template' or 'document template' when editing the category, and even choose whether to apply it to subcategories, so that the content of all subcategories under it inherits the style.
- Flexible content data calling:Template tags are the bridge connecting content and design.
archiveDetailThe tag can obtain detailed information about the current or specified article/product, including title, description, thumbnail, etc. Most notably, it can alsoarchiveParamsLoop through the tags or directly throughname="字段名"Call the various custom fields you define in your content model, allowing you to perfectly integrate exclusive information such as "product model", "color options", and so on into the page layout.
2. Independent page: Create brand story and service portal
In addition to dynamically updated articles and products, websites usually also need fixed content pages such as "About Us", "Contact Us", and "Terms of Service".AnQi CMS is called 'Single Page', and it also gives it powerful personalized display capabilities.
- Exclusive page template:Each single page can specify a "single page template" when editing 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 as
page/{单页面id}.htmlIf it exists, it will be automatically applied. But you can also specify a completely custom template filename for a specific page in the background (such aspage/about-us.html) to meet more personalized needs. - Data call:
pageDetailThe tag can conveniently obtain the title, content, images, and other information of a single page, helping you to build colorful independent pages in templates.
3. Categories and Tags: Personalized Entry for Organizing Content
Categories and tags are an important way to organize website content. The custom templates of Anqi CMS also extend to these levels:
- Differentiated display of category list:By
categoryListLabel, you can get and display a list of classifications for 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 a user clicks on a tag (such as "New Release" or "Special Deals"), they will be taken to a tag page aggregated with all related content.
tagDetailandtagDataListTags allow you to design unique templates for these aggregation pages, highlighting the features of tags, and improving the efficiency of content discovery.
An auxiliary tool for efficient development
The AnQi CMS template system also enhances development efficiency through a series of auxiliary tags:
include: Extract commonly used code snippets (such as headers, footers, sidebars) into independent files and include them where needed to avoid repetition.extends: Implement template inheritance. You can define a basic layout (master), and then let other page templates inherit it, only modifying specific content blocks, greatly simplifying the template structure of large websites.macro:Create reusable code functions, such as generating unified style product cards or article summaries, to improve template maintainability.
Summary
The custom template function of AnQi CMS gives users absolute control over the presentation of website content.It not only provides a stable and reliable framework for content management, but more importantly, through its flexible content model, detailed template specification options, and rich template tags, it allows users to freely create unique and personalized websites based on their brand characteristics, business needs, and user experience goals.From the overall architecture of the website to every content detail, you can use the power of templates to make your content stand out among the vast amount of online information.
Frequently Asked Questions (FAQ)
- Ask: Can I apply a custom template to my article or product without touching the code?
Answer:Can be. 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 name of the template file you have pre-designed (for example
.
download-page.html), the system will automatically apply the specified template when the content item is accessed. - How to call the custom fields (such as 'material', 'color') that I have added for products in the 'content model' in a custom template?
Answer:You can use in the product detail page template,
archiveDetailto call the tag. If your custom field name ismaterial, you can write it directly.{% archiveDetail with name="material" %}To display its value. If you need to loop through all custom fields, you can use{% archiveParams params %}{% for item in params %}{{ item.Name }}:{{ item.Value }}{% endfor %}{% endarchiveParams %}. - If I set a "Category Template" for a category, will it affect all subcategories under that category? Answer:By default, the "category template" set will only affect the display of the current category list page and will not automatically inherit to its child categories. However, when editing the category, you can check