AnQiCMS is a major highlight in content management, with its flexible content model support, which allows the website to structure and display different types of information according to its unique business needs.Understanding how content models operate and how they affect the presentation of front-end content is the key to efficiently using AnQiCMS for website operations.
The content model in AnQiCMS: a customized information blueprint
The content model can be figuratively understood as the 'data structure blueprint' of various types of information on a website.It defines which fields each content type should include, the data format of these fields, and how the editing interface in the background should present them.AnQiCMS comes with built-in 'article model' and 'product model', which provides a foundation for common website content (such as blog articles, news information, product display).
However, the real strength of AnQiCMS lies in allowing users to customize content models.This means that, whether you need to post event information, job openings, case studies, or even complex real estate listings, you can create dedicated models for each type of information.
- Model name and table name:Convenient for background management and internal data storage of the system.
- URL alias:This is the key part that determines the structure of this content in the website front-end URL, for example, if the URL alias of the product model is "product", then the URL of all product detail pages may contain
/product/This is crucial for building a clear, SEO-friendly website structure. - Title Name:Specify the main identifier field of the content type, for example, the main title of the product model may be "Product Name", and the article model is "Article Title".
- Custom field:This is the core elasticity of the content model. You can add unique fields for each content type to capture its specific information. For example:
- For the "article model
- For the "product model
- And for a custom 'event model', it may require fields such as 'event time', 'location', 'registration link', 'maximum number of participants', etc.
These custom fields support multiple data types including single-line text, numbers, multi-line text, single selection, multi-choice, and drop-down selection.You can set whether the field is required according to your actual needs, specify the default value, and ensure the integrity and standardization of the data.
How does the content model affect the display of front-end content?
The definition of the content model directly determines the structure, layout, and dynamic interaction of the front-end page. Its impact is mainly reflected in the following aspects:
URL structure and SEO friendliness:As previously mentioned, the 'URL alias' in the content model is involved in the generation of the front-end page URL. This means that you can plan more semantically meaningful URLs based on the content type, for example
/article/latest-news.htmlor/product/iphone-15.html.Combining the pseudo-static rules feature of AnQiCMS, this structure not only improves user experience but also greatly benefits search engine optimization (SEO), helping search engines better understand and index website content.Dynamic page layout and content presentation:AnQiCMS's template system can recognize the content model associated with the current page.This means you can design completely different template files for pages under different content models.
- Article detail page(Based on the "article model") may need a layout focused on text reading, including author information, publication date, category, tags, and comment sections.
- Product details pageBased on the "product model", it may require large image slideshows, prices, buy buttons, product parameter tables, and other modules.AnQiCMS even supports specifying independent templates for categories or individual documents under specific models, thereby achieving more refined control over the frontend display.
Template tag and data calling:In AnQiCMS template files, through powerful Django style template tags, you can easily call any fields defined in the content model.
- General field call:Use
archiveDetailorarchiveListTags such as, you can get and display general information such as the title, content, thumbnail, views, and creation time of the content. For example,{{archive.Title}}Used to display the title of the article,{{archive.Content|safe}}Used to display the article content (|safeThe filter is used to safely output HTML content). - Custom field invocation:The value of the custom field is fully realized here. If you define a field named in the product model.
PriceThe field can be used directly in the product detail template{% archiveDetail with name="Price" %}To display the price. For custom fields with multiple values (such as multi-select options like 'Color Options'), you can access througharchiveParamsLabel loop to display all options
- General field call:Use