When building website content, we often find that different types of information have unique display requirements.A news article may require a title, author, publication date, and text;A product introduction may cover name, model, price, inventory, and detailed parameters;And a case study may focus more on the project name, client, solution, and results images.Traditional CMS systems often provide fixed and unchangeable content publishing templates, which are difficult to flexibly respond to in diverse business scenarios.
Aq CMS was born to solve this pain point, one of its core advantages is that it provideshighly flexible content model customization featuresThis feature allows you to break free from the constraints of preset frameworks, tailor the management and display methods to meet your actual business logic and content structure, and thus achieve truly diverse content display.
Why do you need to customize the content model?
Imagine that you are running a comprehensive website that includes various business segments, such as an enterprise official website that publishes industry news and sells all kinds of products.News and products have an essential difference in data structure.News may require fields such as "source", "summary", etc., while products must have "price", "specifications", "SKU", etc.If all the content is compressed into an "article" model, it will be confusing to manage in the background, and it will also be difficult to implement personalized layouts and functions on the front page.
The custom content model of AnQi CMS is the ideal solution for such scenarios.It allows you to create independent data structures for different content types, ensuring that the data for each type of content can be managed accurately and efficiently.This not only greatly improves the operation efficiency of the background, but also ensures that every part of the website's front-end content is presented to visitors in the most appropriate and attractive way, significantly enhancing the system's adaptability and user experience.
How to create and configure the content model in AnQi CMS?
In AnQi CMS, creating and configuring content models is intuitive and powerful.Firstly, you need to enter the background management interface, find the "Content Management" section in the left navigation bar, and click on "Content Model" to enter the management page.
The system defaults to built-in "Article Model" and "Product Model" as commonly used models, which can serve as a quick start reference and can be modified as needed.Of course, if you have more unique business needs, you can always click 'Add Custom Model' to create a new content model.
When creating or modifying a content model, you will find some key configuration options:
- Model name: This is the Chinese name of the model recognized in the background, for example, 'Recruitment Information', 'Team Members' or 'Project Case'.
- Model table nameThis is the content data stored in the database table name, it needs to be in lowercase English letters, and the system will read and write data according to this table name.
- URL aliasThis English lowercase alias will be used in the front-end URL path, which helps to build friendly pseudo-static links, such as 'news', 'product', 'team'.
- Title NameThis field replaces the default 'Title' prompt text, for example, in the product model, you can set it to 'Product Name' to make the published content more guiding.
The core to truly achieve diversified content display lies inCustom fields of the content modelHere, you can add an unlimited number of custom fields to your model to collect and store any necessary data.
For example, when creating a "house information" model, you can add:
- "Area": single-line text
- "Layout": dropdown selection (for example: one bedroom, two bedrooms, three bedrooms)
- “Area”:numeric type
- “Price”:numeric type
- “Features”:multiple choices(for example:school district house,subway house,finely decorated)
- “Property pictures”:Picture group type (through the image upload function provided by the system)”
Each custom field can be set to have a “parameter name” (such as “region”, “layout”), “field name” (such as “region”, “layout”), “field type” (single-line text, number, multi-line text, single selection, multiple selection, dropdown selection), and even set “required” and “default value” to ensure the standardization and convenience of data entry.These flexible field types can meet various complex data entry requirements, laying a foundation for the accurate display of front-end content.
How to use the custom content model for diversified content display?
Once the content model and its custom field configuration are completed, the next key is how to beautifully display it on the front end of the website.Our company's Anqi CMS adopts the Django template engine syntax, which is concise and powerful, allowing you to easily display data from the backend to visitors.
For a single content detail page, such as a news article or a product page, you can usearchiveDetailLabel to get the details of the current content, including all custom fields. For example, if you define a name for the product model aspricecustom field, which can be directly accessed through the template on the product detail page{{archive.price}}to display the price, or through{% archiveDetail with name="price" %}tags to call.
Further, if you wish to display all custom fields, especially for lists that may change frequently like product parameters,archiveParamsTags are very practical. They can loop through all custom fields and their values in the content model, allowing you to automatically adapt to new parameters in the background without modifying the template code, which is very suitable for building dynamic product specifications or information lists.
For content list pages, such as news lists or product lists,archiveListThe tag is responsible for retrieving the content set. While iterating through each content item, you can also access all its standard fields and custom fields.This means that you can design completely different layouts for different list pages based on the type of content model.A recruitment information list can highlight the job title, location, and posting time;A team member list can display name, position, avatar, and introduction.
The AnQi CMS also provides powerful template customization capabilities.You can specify an independent template file for a specific category or even a single content page.For example, your "news center" category can adoptarticle/list.htmltemplates, while the "Product Display" category can be enabledproduct/list.htmlTemplate. Even, for a special "About Us" page, you can customize a unique one.page/about.htmlTemplate. This extremely granular template control ensures that each content type on the website has a dedicated visual presentation that matches its properties and functions, truly achieving a perfect blend of content and design, bringing visitors a rich and targeted browsing experience.
The customized content model feature of AnQi CMS is not just about data storage, but also the art of content presentation.It endows the website with great flexibility and expressiveness, allowing your website to evolve continuously according to business development, showcasing diverse and attractive content in the most tailored way to meet user needs.
Frequently Asked Questions (FAQ)
What is the difference between the fields in the custom content model and the title, content, etc. that come with the article/product?Each content in AnQi CMS (whether it is an article, product, or a custom model) will have some fixed and common fields, such as "title", "content", "description", and "thumbnail", etc., which are the basic properties shared by all content types.And the 'custom field' is an additional attribute tailored to a specific content model, which only exists in the content under that model.For example, the "Product Model" under "Price" or "Stock" is a unique custom field, which is usually not needed under the "Article Model".This makes the content structure clearer and management more efficient.
Will the published content be affected if I modify the fields of the content model (for example, adding or deleting a custom field)?In most cases, adding a custom field does not affect the display of published content, but this content will be displayed as empty in the new field. When deleting a custom field, the system will prompt you that this operation will delete all