AnQiCMS version 2.1.1 brings the highly anticipated new feature - 'Model'.This update is not just about adding a few buttons, it fundamentally changes the way we organize and display website content, making the display logic of articles and products more flexible and powerful.This means that for daily operators, we can manage and present various information more finely according to actual business needs, thereby enhancing user experience and the professionalism of the website.
The core function of the model: Customizing the 'skeleton' for content
To understand this new feature, we can understand the content model as a "blueprint" or "skeleton" of the content.Before AnQiCMS v2.1.1, when we published content, it was usually a fixed "article" or "product" type, which had preset fields (such as title, content, thumbnail, etc.).The introduction of the "model" feature makes the structure of these contents no longer fixed, and we can create exclusive structures for different types of content like building blocks.
The system is default built-in with 'Article Model' and 'Product Model', which correspond to the commonly used fields when we publish articles and products.It is more powerful that now we can customize new content models according to our business needs.For example, if your website needs to publish "recruitment information", "event announcements", or "customer cases", you can create a separate content model for each type and define unique fields for them, such as "recruitment information" can have fields such as "position name", "work location", "salary range", etc., and "event announcements" can have fields such as "event time", "registration method", etc.In the "Content Model" management interface, we can add exclusive fields for each model, supporting single-line text, numbers, multi-line text, single selection, multi-choice, dropdown selection, and more, and can set whether it is required and the default value.This flexibility greatly enhances the system's adaptability to a variety of content management scenarios.
How does the model affect the publication and management of content?
The addition of the model function first changed the logic of our content publishing and management on the back-end.
When we are ready to publish a new piece of content, the operational process will become more intuitive and intelligent.When selecting the category, the system will automatically identify the content model bound to the category and dynamically display the fields unique to that model for us to fill in.For example, if you select a category that belongs to 'Product Model', then in the content editing page, in addition to the general title, content, etc., there will also be product-specific input boxes such as 'Price', 'Inventory', and 'Product Parameters'.If the 'Article Model' category is selected, fields such as 'Author', 'Source', etc. may appear.This means that different types of content will have exclusive filling interfaces that are completely in line with their characteristics, avoiding unnecessary field interference and greatly improving the efficiency and accuracy of content entry.
In addition, in terms of content management, the document list has also become more refined.We can filter based on the content model, only view documents of specific models, such as managing all 'products' or 'events' information separately, making content organization and maintenance more orderly.When deleting the model, the system will also remind that all documents and categories under the model will be deleted together, ensuring data consistency.
The model function affects the logic of front-end content display.
The model function also had a profound impact on the front-end display of content, making the development of website front-end templates and content display more flexible and refined.
Formerly, we may have been accustomed to usingarticleorproducttags to obtain content, now all of these are unified into a more generalarchiveUnder the label system, and these labels can now intelligently recognize and handle fields defined in different models.
The most significant change is that now we can go througharchiveDetailandarchiveListlabels, as well as specialarchiveParamsLabel, easily access various custom fields defined in the model. For example, on the product detail page, if your product model defines fields such as 'Size', 'Material', etc., you can use them in the template.{% archiveDetail with name="尺寸" %}or by looparchiveParamsDisplay these unique product information. On the article detail page, you can call fields such as "author" or "source" to ensure that each content type is presented in the most logical and aesthetically pleasing way to the user.
This change is also reflected in the organization of template files. AnQiCMS supports setting independent template files for different content models. For example, we can create{模型table}/detail.htmlAs the detail page template for all contents under the model, as well as{模型table}/list.htmlIt serves as its list page template. This means that the product detail page can have its own unique product image display and parameter table layout, while the article detail page can focus on text reading and related article recommendations, with no interference between them, achieving truly customized display.Even the pseudo-static rules can be passed through{module}Variables associated with the model to generate more semantic URLs.
Brings user value and operational impact
The introduction of the model function undoubtedly brings great value to AnQiCMS users:
- Endless possibilities in content structure:Not limited to "articles" and "products", you can create any content type that meets your business needs, such as cases, tutorials, announcements, Q&A, etc., making the website content more diverse and rich.
- Improve SEO effectiveness:A precise content structure and semantically tagged fields help search engines better understand your website content, improving crawling and ranking effects.The customized model can also be configured with optimal SEO information for different content types.
- Optimizing user experience: Provide a more appropriate display form based on content type, reduce the time users spend obtaining information, and improve user satisfaction.
- Reduce maintenance costs:A unified backend management interface and flexible frontend adaptation mechanism reduces the complexity of developing and maintaining independent modules for different content types.
- Promote the refinement of content operation:For content tailored to different models, you can develop more targeted operational strategies, whether it is in the direction of content creation, promotion channels, or data analysis, all of which can achieve more refined management.
In summary, the new model feature added in AnQiCMS v2.1.1 is an important step for the system in terms of flexibility and customizability.It empowers users to build and present diverse website content with business logic in mind, making every content release purposeful and every content display more in line with user needs, thus injecting new vitality into the long-term development of the website.
Frequently Asked Questions (FAQ)
How to create a dedicated model for existing content types (such as news, cases) and apply it to existing categories?You can find the 'Content Model' feature in the 'Content Management' module on the backend, where you can create a new model, such as 'News Model' or 'Case Model', and then add the required fields (such as 'News Source', 'Publishing Institution', etc.).After creation, you need to enter the "Document Classification" management, edit the classification you want to apply this model to, and bind the classification to the newly created "News Model" or "Case Model".This will display the corresponding model's custom fields when you post content under this category.
How can I determine in the template which model the current content belongs to so that different display logic can be applied?When you go through the template file,
archiveDetailyou can use the tag to get the content details.{{archive.ModuleId}}or{{archive.Module.TableName}}Get the model ID or model table name of the current content. Then, you can use{% if %}Logic judgment to apply different display logic or load different template fragments based on different model IDs or table names. For example, you can judge{% if archive.Module.TableName == "product" %}to display the unique layout of the product or{% if archive.Module.TableName == "article" %}Show article layout.If I customize a model, will it automatically have default fields for articles or products (such as title, content, thumbnail)?Yes, AnQiCMS was designed with versatility in mind.No matter what content model you customize, it will automatically include some core common fields, such as title, content, thumbnail, description, keywords, etc., which are the foundation of all types of content.You add a field in the 'Content Model' called 'Custom Field', which is a supplementary function to meet the unique needs of a specific model beyond these general fields.