When using AnQiCMS to manage website content, we will quickly find that its 'flexible content model' feature is a core tool for content operations.It is unlike traditional CMS, which limits all content within a fixed 'article' or 'page' framework.AnQiCMS gives us the ability to define content structure, allowing us to customize the display of various types of information according to actual business needs, thereby making the website content more accurate and attractive.
Understanding the content model: the foundation for building content
In simple terms, the content model is the "blueprint" for different types of content on our website.Imagine, an e-commerce website not only needs to publish 'articles' to share industry information, but also needs to display detailed information about 'products', and may also need to promote 'events' or showcase 'cases'.Under traditional methods, we may need to distinguish through a specific field of the article or fill a large amount of unstructured information in the editor.
AnQiCMS's content model has fundamentally changed the situation.The system provides default "article model" and "product model", but more powerful is that it allows us to create a new custom model.This means we can define independent content structures for 'events', 'cases', 'services', and any other business needs.Each model can have its own unique field combination, for example, a 'product model' can have fields such as 'product model number', 'price', 'inventory', 'application scenario', etc.;An 'event model' may have 'event time', 'location', 'registration method', and so on.This not only makes content management clearer and more organized, but also lays a solid foundation for the personalized display of the front end.
Custom fields: Create exclusive content types
The most intuitive manifestation of the flexible content model is the ability to customize fields.In the AnQiCMS backend, we can easily enter the 'Content Model' management interface, modify existing models, or create new ones.When adding or editing a model, the core is to define a series of fields for it.
These fields are not just a distinction in names, but also cover a variety of data types to meet different information storage needs. For example:
- Single-line text: Suitable for brief information, such as product titles, author names, event names, etc.
- Number: Designed for numerical data, such as product prices, inventory quantities, event participants, etc.
- Multi-line textUsed for detailed descriptions required, such as product features, event details, and article summaries.
- Single choice/Multiple choice/Dropdown choiceThese field types are very suitable for scenarios that require preset options, such as product color (single selection), product features (multiple selection), and region selection (drop-down).By using preset options, it not only ensures the standardization of data entry, but also facilitates the frontend filtering and display.
When defining these fields, we can also set whether they are 'required' and provide 'default values'.For example, newly released products can default to a "stock quantity" of 0, or pre-set a most commonly used option for some selection fields.This fine control greatly improves the efficiency and data quality of content entry.
Content Entry and Management: Structured Efficient Practice
Once we have defined the content model and its custom fields, their role becomes prominent in daily content publishing and management.When we are ready to publish a new piece of content, we will first select its "category".And a category is already bound to a specific content model when it is created.This means that once we select a category, the content editing interface will intelligently display all the fields defined by the content model.
For example, if we select a category belonging to 'Product Model', the editing page will automatically display fields such as 'Product Model', 'Price', 'Stock', etc. for us to fill in.This makes the content entry process highly structured and intuitive, the content editor does not need to memorize complex field rules, just fill in according to the prompts.This pattern effectively avoids the problem of information omission or format inconsistency, ensuring the standardization and consistency of the website content.
Template Display: Making Custom Content Vivid
It is not enough to define the content model only in the background, the key is how to beautifully display these carefully constructed customized content on the front-end website.The template system of AnQiCMS is closely integrated with the flexible content model, providing powerful display capabilities.
In the template file, we can usearchiveDetailtags to get the details of the current content, including all custom fields. AndarchiveParamsLabels can go further, making it convenient for us to loop through and display the various parameters defined in the model.
For example, in the template of the product details page, we can go through byarchiveDetailGet the main information of the product and then usearchiveParamsLoop output "Brand", "Color", "Size", and other custom attributes to allow users to clearly understand the product features.If a custom field is of image type (such as product multi-angle display images), we can also easily display these images in a loop within the template.
Moreover, AnQiCMS also supports setting independent template files for different content models, categories, and even individual contents.This means we can design a universal template for the 'article list page', a completely different visual style template for the 'product list page', and even apply a unique template for a special 'event detail page'.In this way, the website can present a diverse and professional content layout, greatly enhancing the user experience and adaptability of the website.
In summary, the flexible content model feature of AnQiCMS provides us with a highly customizable content management solution.It makes content no longer just a pile of text, but can be created, managed, and displayed in a structured and standardized way according to business needs.This not only improves the efficiency of content operation and ensures data consistency, but also enables the website to face visitors with a richer and more accurate posture, effectively supporting the operation and development of various websites.
Frequently Asked Questions (FAQ)
1. Can the content model be deleted? What impact will it have after deletion?
The content model can be deleted, but it is a function that requires careful operation.AnQiCMS allows deleting custom created content models.However, once a content model is deleted, all content associated with the model (such as articles, products, events, and other documents) as well as the corresponding categories will be permanently deleted.Therefore, be sure to confirm that you no longer need the model and all related content before performing the deletion operation, to avoid irreversible data loss.The built-in "article model" and "product model" can be modified, but cannot be deleted directly.
2. Can I define multiple different display templates for a content model?
It can be done. AnQiCMS provides a very flexible template mechanism to achieve this. In addition to the default list page of each model ({模型table}/list.html) and detail page ({模型table}/detail.htmlOutside the template, you can also specify a custom template for a specific "category" or a single "document" in the content management. For example, you define a basic detail page template for the "news" model.news/detail.htmlBut a special news feature requires a unique layout, you can specify one for it in the document editing interfacespecial_news.htmlTemplate. Similarly, you can set a unified custom template for all documents under a category. This allows the way content is displayed to be highly personalized according to specific needs.
What is the relationship between classification and content models? Can the classification model be changed arbitrarily?
In AnQiCMS, the category and content model are closely bound.When creating a new top-level category, we must specify a content model for it.Once a category is created and bound to a model, this binding relationship cannot be changed.This means that all content under a category must follow the structure of its respective content model.If you need to migrate content to another model, the usual practice is to create a new category bound to the target model and then manually migrate or republish the content.This design ensures the clarity of content structure and data consistency.