In AnQiCMS (AnQiCMS) design philosophy, modularization is one of its core advantages, aiming to provide users with an efficient, customizable and easy-to-expand content management solution.When discussing the secondary development and expansion of content display functions, it is precisely this modular design that plays a key role, allowing users to create highly personalized website experiences without touching the core code.
Understanding the foundation of modular design
The modular architecture of AnQi CMS is like a set of precision building blocks, with each functional unit being an independent 'building block'.Such design brings significant benefits: each functional point can be independently upgraded and expanded, greatly enhancing the system's adaptability while also reducing the long-term maintenance costs.This means that both website operators and developers can freely customize the display of content within the framework provided by Anqi CMS, without worrying that changes will cause a domino effect.
Content Model: The core power of custom content
The content model is an important part that supports the flexibility of content display in Safe CMS.The system allows us to customize content models based on specific business requirements, which means we can create articles, products, events, cases, and various types of content structures, and define unique fields for each type.
For example, a "product" model may need to include fields such as "product nameThrough the content model management interface on the backend, we can easily add these custom fields and specify their types (such as single-line text, numbers, multi-line text, radio, checkbox, etc.).Once the content model is defined, all content of this type that we publish will follow this structure.In content display, these custom fields can be directly called through template tags, allowing each content type to be presented in the most fitting way for its characteristics, greatly enhancing the personalization and system adaptability of content publication.
Template System: The 'brush' for content display
The template system of AnQi CMS is a powerful tool for content display secondary development and expansion.It uses a template language similar to Django, which allows users familiar with front-end development to get started quickly.
Flexible template file organization:All template files are stored centrally in
/templateThe directory supports folder organization or flat organization mode. At the same time,config.jsonThe file defines the basic information of the template,partial/The catalog is used to store reusable code snippets such as headers, footers, and sidebars. This clear structure makes template management and collaboration well-organized.Code reuse and structure inheritance:
includeLabels allow us to embed common code snippets (such as headers, footer navigation) into any template, avoiding repetition and improving development efficiency.extendsThe tag supports template inheritance, we can define a basic skeleton (base.html), and then let other page templates inherit this skeleton and only rewrite specific blocks.blockThis is crucial for maintaining the overall style consistency of the website while allowing flexible adjustments to the local areas.macroThe label takes it a step further, allowing us to create reusable code blocks (similar to functions), dynamically generating content in the template based on the variables passed in, further enhancing the maintainability and reusability of the template.
Rich built-in tags and filters:AnQi CMS provides nearly 40 built-in template tags, covering all aspects of content display. Whether it is to obtain a document list (
archiveList), category details(categoryDetail), single page content (pageDetail),or breadcrumb navigation(breadcrumb)、friend links(linkList),even system configuration information(system)and contact information(contact),have corresponding tags that can be directly called. Additionally, a large number of filters (such assafe/truncatechars/stampToDate/addIf the value is set to auto, it gives us the ability to process content in a refined manner, such as safely outputting HTML content, truncating long texts, and formatting timestamps.These tags and filter combinations allow us to achieve various complex and dynamic content display effects without writing a single line of backend code.seamless integration with custom parameters:Through the "Global Function Settings" and "Contact Information Settings" in the background, and the "Custom Setting Parameters" feature, we can add any custom key-value pair information to the website. This information can be accessed through the template.
systemorcontactLabels can be easily called, which brings great flexibility to content display, such as adding a 'WeChat Customer Service QR code' or a 'specific event link', all of which can be configured in the background and displayed directly in the template.
The flexible application of extended functions
Modular design is not only reflected in the content and template itself, but also extends to various website functions:
- Custom URL static URL redirection:We can customize the structure of the URL according to the requirements. For example, set the article link to
/articles/title.htmlor/archives/id.htmlThis not only helps with SEO optimization, but also makes the URL structure of the website more readable and logical, thereby indirectly affecting the display of content and the user experience. - Content display under multi-site management:Even when running multiple AnQiCMS sites on the same server, due to their modularization and independence, each site can have completely independent templates and content display logic.This makes it possible for a set of AnQiCMS to support independent content display needs for multiple brands or businesses.
- Opening of API interfaces:Although it is not directly used for front-end content display, the provided API interface (such as importing articles, friendship links, etc.) allows integration with other systems, transferring the content managed by AnQiCMS to more platforms for display, thereby expanding the ability to display content from a broader perspective.
In summary, the modular design of Anqi CMS provides a solid foundation and high degree of freedom for the secondary development and expansion of content display functions.From flexible definition of content structure, to highly customized and reusable at the template level, to fine-grained configuration of various functions, all without touching the core code, allowing the website to quickly respond to business changes and continue to iterate and develop.
Common Questions (FAQ)
1. How to apply completely different display templates to different types of content (such as articles, products)?The Anqi CMS supports this through the combination of 'Content Model' and 'Category Template/Documents Template'.First, create the respective content models for articles and products in the background, and define the corresponding fields.product/list.htmlUsed for product lists,article/list.htmlUsed for article lists), even for a single "document", you can specify a "document template" (such asproduct/detail-iphone.htmlUsed for iPhone product details). The system will automatically match and load the corresponding template file based on the content model or ID, achieving a diverse display effect.
2. How to obtain and display the additional information I customized in the "Global Settings" on the backend in the template?In the "Global Function Settings" or "Contact Information SettingsCustomSlogan,parameter value is “Make website building easier”)。Then, in the template, you can use `{% system with name=“CustomSlogan” %”}]