In website operation, the diversity of content is the key to attracting users, improving experience, and optimizing search engine rankings.AnQiCMS provides a highly flexible mechanism that allows users to break free from the constraints of traditional content management systems (CMS) such as 'articles', 'products', etc., and achieve truly diverse content display through custom content models.

Why do you need to customize the content model?

Imagine that you are running not just a blog, but a comprehensive platform that includes recruitment information, real estate rental, online courses, event registration, and a variety of other businesses.If all the content is squeezed into the framework of "article" or "product", then the structure of the content will become chaotic, the display of information will be greatly discounted, it will be extremely difficult for users to find information, and it will also not be conducive to the refined management of content and the crawling of search engines.

The custom content model feature of AnQiCMS is exactly for solving these problems.It allows you to create exclusive 'data blueprints' based on specific business requirements, ensuring that each type of content can be published and displayed in the most appropriate and structured way.For example, you can define position name, salary range, work location, and skill requirements for 'Recruitment Information'; define event name, time, location, and registration limit for 'Event'.This flexibility greatly enhances the adaptability of the system, allowing your website to carry various forms of content.

Create a custom content model: Practice from Zero to One

On the AnQiCMS backend, you will find an option for the 'Content Model' under the 'Content Management' module.This is the core management area of all content models.The system is pre-installed with "Article Model" and "Product Model", which are commonly used content types, but you can create more according to your needs.

Creating a new content model requires attention to several core settings:

  1. Model name:This is a user-friendly identifier, for example, you can name it "Recruitment Information", "Real Estate Lease" or "Event Details".This name will be displayed in the backend management interface, helping you and your team distinguish between different types of content.
  2. Model table name:This is a technical identifier used to store the table name of the model data in the database.For the stability and standardization of the system, it is usually necessary to use English lowercase letters and ensure their uniqueness.
  3. URL alias:This alias will be used for the URL path of the website's front-end content, which is crucial for the SEO-friendliness of the website. It is also recommended to use lowercase English letters, for example, if you created a "Event Details" model, the URL alias could beeventThen the link to the activity content might be/event/活动ID.html.
  4. Title Name:This is a thoughtful design, it defines the prompt text for the "Title" field when you publish the model content.For example, for the "Recruitment Information

Customize deeply: Define exclusive fields for your model

After creating the basic information of the content model, the real flexibility is reflected in the "Content Model Custom Fields" section.You can add any fields you need to your new model to accurately describe this type of content.

  • Single-line text:Suitable for brief text information, such as 'product brand', 'author name', 'event contact', etc.
  • Number: Designed for numeric input, such as "product price
  • Multi-line text:Content suitable for longer descriptions, such as 'Product Detailed Description', 'Event Rule Explanation', 'Job Position Responsibilities', etc.
  • Single choice, multiple choice, dropdown choice:These three types of fields are a boon for structured data.They allow you to preset a series of options, from which the user can select (single) or select multiple (multiple).For example, you can set dropdown selection fields such as 'house type' (one-bedroom, two-bedroom, etc.), 'renovation status' (finishing, rough) for the 'real estate rental' model, and set multiple selection fields such as 'color', 'size' for 'products'.These fields not only standardize the data, but also lay the foundation for subsequent content filtering and display.

Each custom field can be set to 'required' and 'default value', which helps ensure the completeness of the content and reduce the operation threshold.For example, if you want all job information to include salary ranges, you can make that field required.

Seamless connection between content model, classification, and content publishing

The custom content model does not exist in isolation, it is closely connected with AnQiCMS's 'Document Classification' feature.When creating a category, you need to specify the content model to which the category belongs.This means that all content under a category will follow the field structure of its associated content model.

When you publish content, first select a category, AnQiCMS will intelligently display the corresponding custom fields according to the content model of the category.This way, whether you publish ordinary articles, product information, or customized recruitment, event content, you can fill in the required information in the most intuitive way under a unified publishing interface.

Diverse content display: Let the custom model shine in the foreground

It is not enough to define the model only in the background. How to display these carefully organized contents on the website front-end is the key to achieving diversified display. AnQiCMS provides powerful template tags that allow you to easily call and display the data of custom models:

  1. archiveDetailTags:When you need to display detailed information about a single item,archiveDetailIt is your preference. Through this tag, you can directly access any field in the custom model. For example, if you have an 'activity' model that definesactivity_dateandactivity_locationField, you can call it like this in the template:{{archive.activity_date}}and{{archive.activity_location}}.
  2. archiveParamsTags:Sometimes, you may want to list all the custom fields and their values in a unified area (such as the 'specifications and parameters' section on a product details page).archiveParamsTags can help you traverse all custom fields of the content model, which is very suitable for dynamically displaying various product parameters.
  3. archiveListTags:Used for displaying various content in lists. CombinedmoduleIdParameter, you can accurately obtain the list of specific content models. For example, only display the list of 'Recruitment Information' models.
  4. archiveFiltersTags:This is the core to achieve advanced content filtering and diverse display.If you operate a real estate rental website and customize fields such as 'price range', 'house type', 'area', etc., then users can filter through these fields on the front end to find the housing they want.archiveFiltersLabels will automatically generate these filter conditions and their corresponding links, greatly enhancing user experience.

Moreover, AnQiCMS also supports customizing template files based on the table name of the content model. For example, you can createevent/detail.htmlandevent/list.htmlFiles, used to customize the individual content display page and list page of the "Event Details" model, thus achieving a completely personalized visual presentation.

**Practice and Precautions

  • Plan in advance:Before starting to create the model, it is crucial to spend some time planning the content structure.Make clear what types of content are needed, what fields each type contains, what the field types are, and how they may be displayed and interacted with on the front end.
  • Operate cautiously:This content model deletion is an irreversible operation, it will delete all the content and categories under the model at the same time. Be sure to confirm multiple times before performing the deletion.
  • Maintain naming conventions:Choose clear and concise English names for model table names and fields, which will help with template development and subsequent data maintenance.
  • Consider SEO:Custom models and fields provide more opportunities for SEO.For example, by creating custom fields to generate more descriptive URLs, or setting unique TDK (title, description, keywords) for specific content types.