When building and operating a website, content should not only be diverse, but also presented in a flexible and varied manner to adapt to ever-changing business needs and user experience.AnQiCMS's modular design is exactly for this, providing a complete set of mechanisms to make the expansion and customization of front-end content efficient and intuitive.

AnQiCMS breaks down its core functions into independent and combinable modules, which enables the system to have high flexibility.This modularization is first reflected in the design of its 'content model'.The traditional CMS often presets 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 listThis depth of content structure customization ability lays a solid foundation for the endless possibilities of front-end display.

On the content presentation level, AnQiCMS provides a powerful and easy-to-use template engine that follows the syntax of Django templates, allowing developers to control every detail of the page in an intuitive manner. Template files are processed through.htmlSuffix management, and support{% extends %}/{% include %}and{% macro %}tags, greatly improves the reusability and maintainability of templates. For example, throughextendsLabel, we can define a universal base layout (such as header, footer, sidebar) for the entire site, and then let all pages inherit this skeleton. All you need to do in specific page templates is fill in or overwrite the specific content.{% block %}Area. AndincludeTags allow us to include commonly used code snippets (such as navigation menus, advertisement slots) 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 built-in rich tags and filters for dynamically retrieving and processing content. For example:

  • Content retrieval tag:{% categoryList %}Can retrieve category list based on conditions (such as model ID, parent ID);{% archiveList %}Can retrieve article or product list, supporting various sorts, filters, pagination, and calls for associated content (such as related articles);{% pageList %}and{% tagList %}Then it 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 the specific article, product, or single page detail page,{% archiveDetail %}/{% categoryDetail %}/{% pageDetail %}and{% tagDetail %}Can accurately extract various properties of the current content, including fields defined in custom models. For example, if the 'price' field is customized in the product model, it can be accessed directly through{% archiveDetail with name="价格" %}Displayed on the front end.
  • Global Information Tag:{% system %}/{% contact %}/{% tdk %}These tags are responsible for seamlessly integrating the global data such as the website name, contact information, SEO information, etc., configured on the back-end into the template.
  • Auxiliary logic tags:{% if %}and{% for %}This logic label provides the ability to make conditional judgments 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.
  • A powerful filter: Through{{变量|filter__name:param}}in the form, users can perform various processing on the output content, such as|safeto safely render HTML code,|truncatecharsto truncate long text,|dateUsed for formatting time and others, which greatly enhances 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 specific ID content.This means that the "About Us" page can have a layout completely different from the "News and Information" list page, and a special "Promotional Products" can even use a customized detail template.Combining the multi-site management function, the same AnQiCMS backend can drive multiple websites with independent domain names, content models, template themes, and frontend styles, truly realizing the 'one core, multiple uses, and diverse changes' of content.

In summary, the modular design of AnQiCMS builds a solid bridge for the flexible expansion and custom display of front-end content.From the fundamental content model definition, to the middle-level template system and tag filters, and finally to the upper-level template file organization and multi-site management, AnQiCMS enables users to break free from the fixed limitations, finely control the structure, data, and ultimate presentation effect of the content according to specific needs, thereby creating a truly personalized, efficient, and attractive website experience.

Common Questions (FAQ)

1. How to display the custom field content I defined in the content model on the front-end page?You can directly use{% archiveDetail %}/{% categoryDetail %}or{% pageDetail %}tags, and throughnameThe parameter specifies the custom field name you define. For example, if your product model has a custom field named "Product Model", you can use it in the product detail page template.{% archiveDetail with name="产品型号" %}Show its value. For custom fields that need to be traversed (such as multiple image uploads), you can use{% archiveParams %}tags to retrieve and loop output.

2. I want the layout of some specific pages to be completely different from the default template, can AnQiCMS do that?Of course, you can.AnQiCMS supports specifying custom templates for individual documents, categories, or single pages.special-layout.html),and ensure that the file exists in your theme template directory, the system will prioritize using the custom template for rendering.

3. If I input HTML code in the content editor and want it to be displayed as is on the front end without being escaped, what should I do?By default, to prevent security risks (such as XSS attacks), AnQiCMS template engine automatically escapes HTML content. If you confirm that the content is safe and you want to parse and display HTML code as is, you can use|safea filter. For example,{{ archive.Content|safe }}It willarchive.ContentThe HTML code is output as the original HTML, rather than displaying it as plain text.