In this era where content is king, the content of websites is no longer limited to simple articles and news.From e-commerce products to event information, from customer cases to job positions, each type of content has its unique structure and display requirements.If a content management system (CMS) can only use a single 'article' template to carry all information, it will undoubtedly bring great difficulties to operation, not only low content management efficiency, but also the front-end display looks monotonous, difficult to attract users.

One of AnQiCMS's core advantages is that it provides flexible content model functionality, which completely solves the problem of diverse content structure.It is not just a content publishing tool, but also a platform that truly brings the structure of your website content to life.

The value of the content model: Say goodbye to the monotonous

Imagine if you run an e-commerce website, you need to display product images, prices, inventory, SKUs, and other information; if you are an event organizer, you need to post event dates, locations, registration links, organizers, and other details; or if you are a company, you need to post job information, including job titles, responsibilities, requirements, and salary ranges, etc.These far exceed the scope of traditional 'title + content' articles.

In AnQiCMS, the flexible content model means that you can create dedicated data structures for different types of content according to your business needs. This means:

  • Data structures are more preciseEach content type has its unique fields, ensuring that all key information can be systematically managed and displayed.
  • Content management is more efficient: When entering content on the back end, the form will dynamically adjust according to the content model you select, only displaying relevant fields, avoiding redundant information, and greatly enhancing operational efficiency.
  • More diverse front-end displayCombine template tags to present specific fields of different content in a more attractive and logical way to users, enhancing user experience and conversion rates.
  • SEO optimization more refinedThe structured data is easier to understand by search engines, and with the built-in SEO tools of AnQiCMS, it can effectively improve the search engine visibility of the website.

The core concept of AnQiCMS content model: Customization and flexibility

AnQiCMS system is default built-in with 'Article Model' and 'Product Model', which provides an out-of-the-box solution for most websites.However, its real strength lies in the fact that you can create an unlimited number of custom content models based on your unique business needs.This is like giving your content management infinite 'transformation ability,' able to easily handle any complex content structure.

The core of the content model is to define the "skeleton" of the content, that is, which fields it includes, what type each field is, and how it is managed and displayed.

How to create and apply diverse content structures in practice

To fully utilize the flexible content model of AnQiCMS, usually just a few simple steps are needed.

First step: Define your content model

First, we need to define a new content model in the background. For example, we want to create a 'event information' content model.

Log in to the AnQiCMS admin panel, go to the 'Content Management' menu, and select 'Content Model'.You will see the list of existing models.Here, you can click the 'Create Model' button.

In the interface for creating a new model, you need to fill in some basic information:

  • Model name: This is a Chinese name for easy identification by backend operators, such as "Event Information".
  • Model table nameThis is the table name stored in the database for content data, it is recommended to use meaningful lowercase letters, for exampleactivitiesThis name will also be used when calling the front-end template.
  • URL aliasThis name is used in the rule of pseudo-static, as part of the URL, and it is recommended to use lowercase English letters, such asevent. It will affect the link structure of your website's active pages, such as/event/123.html.
  • Title NameThis is the prompt text for the document title field when publishing content, for example, you can set it to 'Event Title' to make the content publisher clearer about what to fill in.

The core part is coming -Custom fields for content model. Here you can add exclusive fields for the 'Event Information' model:

  • Parameter Name: This is the field name displayed on the backend editing interface to the content publisher, such as 'Event Date', 'Event Location', 'Organizer', 'Ticket Price'.
  • Field invocationThis is the field name used by the template developer when calling data on the front-end, it must be alphabetic, for exampleevent_date/location/organizer/ticket_price.
  • Field type: AnQiCMS provides various field types to adapt to different data storage needs:
    • Single-line text: Suitable for short text information, such as 'Event Location', 'Organizer Name'.
    • Number: Suitable for numerical data such as 'ticket price', 'remaining quota'.
    • Multi-line text: Suitable for long descriptive texts that require detailed descriptions, such as 'event introduction', 'cautions'.
    • Single choice/Multiple choice/Dropdown choiceThese types are used to provide preset options, such as "Activity status (Ongoing, Completed)" and "Activity type (Online, Offline, Hybrid)".When setting, you just need to enter an option in the "default value" column, and the system will automatically parse it.
  • Mandatory?: You can set the field as required based on its importance to ensure the completeness of key information.
  • Default valueSet a default value for the field to improve the convenience of content publishing.

By such settings, we have created a content model for "event information" with specific fields such as "event title

Step 2: Content Publishing and Categorization

After the content model is defined, the next step is to allow content publishers to use it. AnQiCMS closely integrates the content model with 'Document Classification'.

You can create or edit a category under 'Content Management', such as the 'Latest Activities' category.In the category settings, you can select the 'document model' associated with this category. At this time, we choose the 'activity information' model we just created.

When the content publisher chooses to "publish documentIt is amazing that the document editing interface automatically loads all custom fields, such as 'Event Date', 'Event Location', etc., based on the 'Activity Information' model associated with this category.The publisher only needs to fill in the information according to the prompts, the entire process is intuitive and efficient.

Step 3: Front-end display: Display the data on the website

The content model makes backend management organized, while the powerful template engine and rich tags of AnQiCMS allow these structured data to be flexibly displayed on the website front-end.AnQiCMS supports Django template engine syntax, making template creation very easy to get started with.

To display the data of our 'Event Information' model, we can use the following tags:

  • archiveListTagUsed to retrieve the list of activities. You can specifymoduleIdTo retrieve the content of a specific model, for example: “`twig {% archiveList activities with moduleId=“your activity model ID” type=“page” limit=“10” %} {% for item in activities %}

    {{ item.Title }}

    The date of the event:{% archiveDetail eventDate with name=“event_date” id=item.Id %}{{ eventDate }}

    Event Location:{% archiveDetail