Document classification management: Building a clear content architecture
In AnQiCMS, document classification is the foundation of website content organization.It not only determines the ownership of the content, but is also a key carrier for content models and custom field applications.By categorizing, we can build a clear and logical content architecture for the website, where articles, products, and any other type of information can find their accurate location.
When you create or edit document categories in the background, the primary task is to select the 'document model' it belongs to.This is crucial because once the classification is created and bound to a document model, the model cannot be changed any longer.This means that all contents under a category will follow the field specifications of its corresponding document model.For example, if you select the 'Article Model' for the 'News Center' category, all news content under this category will have the fields defined by the article model, such as title, content, publication time, etc.Similarly, if the 'Product Display' category selects 'Product Model', the products under it will have unique fields such as product name, price, stock, etc.
On the category settings page, you can configure various options that help with content organization and front-end display.The category name is the key identifier displayed on the front end, while the category introduction can be used as the description information in TDK (Title, Description, Keywords) to assist in SEO optimization.In addition to these basic information, you can also adjust the display order of categories to prioritize important or popular categories.In terms of SEO, the system provides settings for SEO titles and keywords, allowing you to tailor more search engine-friendly metadata for each category.The Custom URL feature provides you with greater flexibility, allowing you to customize the URL path of category pages according to your business needs, further enhancing SEO performance.
To enrich the visual presentation of the classification page, AnQiCMS also supports setting banners and thumbnails.You can upload multiple Banner images to achieve a carousel effect, or set a representative thumbnail for each category to be displayed in the list or navigation.In addition, the category content field allows you to add detailed descriptions or explanations to the category page, which is particularly useful in scenarios where a deep elaboration of the category is required.The setting function of the classification template, allowing you to apply unique page layouts to different classifications, for example, you can specify a special template for file downloads for the 'Download Center' classification to meet its specific functional requirements.Furthermore, you can choose whether to apply the category template to its subcategories, realizing template inheritance or independent configuration.
Flexible settings and applications of custom field categories
The custom fields of the category are not set individually on the category editing page, but are managed uniformly through the associated 'content model'.This design approach ensures that all categories and documents under the content model can share a standardized data structure, which improves the system's maintainability and scalability.
You need to first enter the "Content Model" management interface in the backend to set custom fields for categories.AnQiCMS comes with two commonly used models: 'Article Model' and 'Product Model', and the system also supports creating new custom models.In the content model editing interface, you can add exclusive custom fields for the model.
The 'parameter name' is the Chinese display name of the field in the background management interface, such as 'article author', 'product series', etc., which is convenient for operation personnel to understand and fill in.
The term is "Field Name", which is the actual English name of the field stored in the database and also the identifier used to call this field in the front-end template, for exampleauthororproduct_seriesSuggest using concise and clear English letters.
Next is the selection of 'field type', AnQiCMS offers a variety of flexible field types to meet different data storage needs.This includes 'Single-line text' for short text inputs, such as author name; 'Number' for numeric data, such as inventory quantity; 'Multi-line text' for long text inputs, such as detailed descriptions; as well as 'Single-choice', 'Multiple-choice', and 'Dropdown' options, used to define preset options for data such as product color, size, etc.For selection fields, you need to enter all optional items line by line in the "Default Value".
Finally, the setting of 'whether mandatory' determines whether the field must be filled in when publishing content or editing categories. A reasonable setting of mandatory items helps ensure the completeness and standardization of the content.
By this means, you can define fields such as 'source', 'editor-in-chief', etc. for the article model, and define fields such as 'brand', 'model', 'material', etc. for the product model.When these models are bound to categories, these custom fields will automatically appear on the category or document editing page for you to fill in and manage.
When calling these custom fields in front-end templates, it is usually usedcategoryDetailtags. If you want to display a specific custom field value, you can use it directly{% categoryDetail with name="自定义字段名" %}The way. For example, if you define a custom field namedbanner_descriptionfor storing the description text of the Banner, then you can use it in the template by{% categoryDetail with name="banner_description" %}to retrieve and display its content. For some custom fields that require looping display, such as custom image group fieldscatimages, you can combinecategoryDetailandforLoop to output one by one. This flexible calling method allows you to present the content of custom fields accurately at various corners of the page according to the design requirements of the website.
By fine-tuning document classification and flexible configuration of custom fields, AnQiCMS empowers operators to build structured, content-rich, and highly personalized websites, thereby better serving target users and achieving the operation goals of the website.
Common Questions (FAQ)
1. Can a category be changed to a different content model after it has been created and associated with a content model?Not allowed.In AnQiCMS, once the category is bound to the content model, it cannot be changed.This is to ensure the uniformity and stability of the content data structure.If necessary to change, it is recommended to create a new category and associate the required content model.
2. Why don't I see the custom fields I added for the content model on the category editing page?Make sure the custom field you add is for 'Categories', not just for 'Documents'.In the content model, the setting area for custom fields will clearly distinguish whether it is applied to documents (archive) or categories (category).If you add fields applied to documents for the model, they will appear on the document editing page but not on the category editing page.
How to loop through and display all custom fields of a category in a frontend template instead of calling them individually?You can use{% categoryDetail extras with name="Extra" %}obtains an array or a map of all custom fields (depending on your configuration), then use{% for field in extras %}to iteratefield.Name(field name) andfield.Value[Field value] to display. This method is particularly suitable for scenarios with a large number of custom fields or when dynamic rendering is required in the template.