When building and operating a website, content must not only be diverse but also presented in a flexible and variable manner to adapt to changing business needs and user experience.AnQiCMS modular design is born for this, it provides a complete set of mechanisms to make the expansion and customization of front-end content efficient and intuitive.
AnQiCMS has decomposed its core functions into independent and combinable modules, which makes the system highly flexible.This modularization is first reflected in the design of its 'content model'.The traditional CMS often pre-sets several content types, such as articles, pages, etc., but AnQiCMS allows users to customize various content models according to actual business scenarios.This means that whether you need to manage the "product list" and its detailed parameters (such as color, size, inventory), or build a "service case" display (including project cycle, customer reviews), or design a "team member" introduction (name, position, profile, social media links), you can easily create corresponding models and define exclusive field types for each model, such as single-line text, multi-line text, numbers, radio buttons, checkboxes, even file upload, and so on.This deep content structure customization capability lays a solid foundation for the infinite possibilities of front-end display.
On the content presentation level, AnQiCMS provides a powerful and easy-to-use template engine, which adopts the syntax of Django templates, allowing developers to control every detail of the page in a straightforward manner. The template files are processed through.htmlSuffix management and support{% extends %}/{% include %}and{% macro %}Labels, greatly improving the reusability and maintainability of templates. For example, byextendsLabel, we can define a universal basic layout (such as header, footer, sidebar) and then let all pages inherit this skeleton, just fill in or rewrite the specific parts in the specific page template.{% block %}And.includeLabels allow us to import commonly used code snippets (such as navigation menus, advertisement spaces) as separate files, avoiding repetition. Furthermore,macroTags can even allow users to create template functions with parameters, achieving more refined componentization.
In addition to structured template inheritance and componentization, AnQiCMS also integrates rich tags and filters for dynamically acquiring and processing content. For example:
- Content acquisition tag:
{% categoryList %}You can get the category list according to conditions (such as model ID, parent ID);{% archiveList %}Can retrieve article or product lists, supporting various sorting, filtering, pagination, and associated content calls (such as related articles);{% pageList %}and{% tagList %}This is used to get the single page and tag list. These tags can directly inject the background configuration data into the front-end page. - Detail display tagWhen entering a specific article, product, or single page detail page,
{% archiveDetail %}/{% categoryDetail %}/{% pageDetail %}and{% tagDetail %}Can accurately extract the various properties of the current content, including fields defined in custom models. For example, if a price field is defined in the product model, it can be accessed directly through{% archiveDetail with name="价格" %}Display on the front end. - Global Information Tag:
{% system %}/{% contact %}/{% tdk %}These tags are responsible for seamlessly integrating global data such as the website name, contact information, and SEO information configured on the back end into the template. - Auxiliary logic tags:
{% if %}and{% for %}Logical tags provide the ability for conditional judgment and loop traversal, making dynamic content organization possible.For example, you can decide whether to display a certain area based on whether a field has a value, or loop through an image array to generate a carousel. - Powerful filter: Pass
{{变量|filter__name:param}}The form, the user can process the output content in various ways, for example|safeUsed to safely render HTML code|truncatecharsUsed to truncate long text|dateUsed for formatting time and so on, all of which greatly enhance the expressiveness of front-end content.
AnQiCMS also pushes the customization of front-end content display to a higher level through flexible template directory structures and multi-site management functions.Users can specify independent template files for different models, categories, and even content with specific IDs.This means that the 'About Us' page can have a layout completely different from the 'News and Information' list page, and a special 'Promotional Product' can even use a customized detail template.Combining multi-site management features, the same AnQiCMS backend can drive multiple websites with independent domains, content models, template themes, and frontend styles, truly realizing the
In summary, AnQiCMS's modular design has built a solid bridge for the flexible expansion and customized display of front-end content.From the bottom-level content model definition, to the middle-level template system and tag filter, and finally to the top-level template file organization and multi-site management, AnQiCMS allows users to break free from the fixed limitations, finely control the structure, data, and final presentation effect of content according to specific needs, thereby creating a truly personalized, efficient, and attractive website experience.
Frequently Asked Questions (FAQ)
1. How to display the field content I customized in the content model on the front-end page?You can use it directly.{% archiveDetail %}/{% categoryDetail %}or{% pageDetail %}Label, and throughnameSpecify the field name you have customized. For example, if your product model has a custom field named "product model", you can use it in the product detail page template by{% archiveDetail with name="产品型号" %}To display its value. For custom fields that need to be traversed (such as multi-image upload), you can use{% archiveParams %}tags to obtain and loop through.
2. I want the layout of some specific pages to be completely different, rather than using the default template, can AnQiCMS do that?Of course you can. AnQiCMS supports specifying custom templates for individual documents, categories, or single pages.You just need to edit the content in the background when you fill in the name of the template file you have designed in the "Document Template", "Category Template", or "Single Page Template" options (for examplespecial-layout.html),and ensure that the file exists in your theme template directory, the system will use the custom template for rendering priority.
3. How do I enter HTML code in the content editor so that it is displayed in the front end without being escaped?By default, to prevent security risks (such as XSS attacks), the AnQiCMS template engine automatically escapes HTML content. If you confirm that the content is safe and you want the HTML code to be parsed and displayed as is, you can use|safeFilter. For example,{{ archive.Content|safe }}Willarchive.ContentThe HTML code should be output as raw HTML rather than displayed as plain text.