On the day when content operation is becoming more and more refined, the personalized display of website content has become the key to attracting users and improving user experience.AnQiCMS (AnQiCMS) provides us with powerful tools with its flexible content model, allowing us to customize the structure and presentation of content according to various business needs.This article will delve into how to flexibly use the content model in Anqi CMS, making your website content display more distinctive and practical.
Unlock AnQi CMS content model: Create endless possibilities for personalized content display
The 'Content Model' function of AnQi CMS is specifically designed to address this pain point.It allows us to break out of predefined frameworks, create and define a brand new content structure based on actual business needs, thereby achieving true personalized content management and display.
Understand the content model: The foundation of customization
The content model is a blueprint defined in Anqi CMS for a category of basic and extended content attributes.The system provides the basic models of "Article Model" and "Product Model" by default, which already include the basic fields required for our daily content publishing, such as title, content, thumbnail, etc.However, when faced with more specific and complex content types, such as 'event model', 'team member model', 'service case model', or 'housing information model', etc., custom content models become particularly important.
By customizing the content model, we can accurately define dedicated fields for each content type, ensuring that each piece of content can be stored and displayed completely and accurately with all necessary information.This not only improves the efficiency of content management, but also provides a solid data foundation for personalized design of the front-end page.
Create and customize your exclusive content model
To start customizing the content model, first you need to log in to the Anqin CMS backend, find the "Content Management" menu under the "Content Model" option.Here, you can see the list of existing models and can add or modify models.
When you decide to create a new content model, there are several core settings that we need to consider carefully:
- Model name:This is the Chinese name displayed in the background management interface of the model, which should be concise and clear, easy to identify. For example, 'Tour route', 'Course information'.
- Model table name:This is the table name stored in the database for model data,Must use lowercase English lettersAnd cannot be duplicated with other model table names.This is the key identifier for internal recognition and storage of data.For example, “travel_route”, “course_info”.
- URL alias:This is the alias used to generate the content page URL,It is also recommended to use lowercase English lettersThis is very important for SEO (Search Engine Optimization). It will be reflected in the structure of your website links, such as
www.yourdomain.com/travel_route/. - Title Name:This field is the prompt text for the main title input box when publishing new content, which can be customized according to the model type, such as 'route name', 'course title', to make it clear to the content entry personnel.
Custom field: the 'skeleton' of the content
After the core settings are completed, the place where the flexibility of the content model truly comes into play is in the "custom fields of the content model".Here you can add unique fields for the current model that meet specific business requirements.Imagine if your 'Travel Route' model, in addition to the title and main content, also needs fields such as 'Destination', 'Number of Travel Days', 'Departure City', 'Traffic Mode', 'Items Included in Cost', etc., all of which can be added one by one here.
When adding a custom field, you need to pay attention to the following key properties:
- Parameter name:This is the Chinese name of the field displayed and managed in the background, such as 'destination', 'number of travel days'.
- Call field:This is the unique identifier used when referencing the field in the template,Must use English lettersAnd it is recommended to use camel case or underscore naming to ensure clarity when calling the template. For example, the corresponding "destination" can be set to
destination,“Travel days” can be set totravel_days. - Field type:This determines the data storage format and input