When using Anqi CMS to manage website content, if you want each document's detailed content to be presented in a unique and eye-catching manner, the system provides very flexible personalized settings.This is not just about changing the text color or font size, but also about deep customization from the content structure to the display form.

Firstly, the foundation of personalized display lies inContent model and custom fields. Anqi CMS allows us to create different content models according to actual business needs, such as 'articles', 'products', 'news', and even 'cases'.Each model can have its own unique fields. For example, the 'Article' model may only need 'author' and 'publish date', while the 'Product' model can add detailed parameters such as 'price', 'inventory', 'brand', and 'material'.These custom fields greatly enrich the content dimensions of the document, providing data support for subsequent personalized display.

Next,Flexible use of templatesThe key to personalized presentation. Anqi CMS provides multi-level template customization capabilities:

  1. Default model template:The most basic personalization starts at the model level. For each content model (such as "article" or "product"), we can specify a default detail page template (usually{模型table}/detail.htmlFor examplearticle/detail.htmlorproduct/detail.html)。Thus, all documents belonging to the model will automatically adopt this template for display. If the product requires a special layout, it can be modifiedproduct/detail.html,and it will not affect the display of the article.

  2. Category-specific template:In some cases, all documents under a certain category need a special display style.For example, all products under the "Promotion Activities" category may need to display more promotional information.At this time, we can specify a "document template" in the settings when editing document categories.This template will override the default template at the model level, causing all documents in this category (regardless of their model, but ensuring that the template content is compatible) to use this dedicated template.

  3. Custom template for a single document:If we want to present a specific document uniquely, such as an important download page or a special product introduction page, Anqi CMS also supports the ability toSingle documentSpecify an independent template. When editing the document, simply enter the filename of the custom template (for exampledownload.html), the system will use this template to render the detailed content of the document first, with a higher priority than the category and model templates.

  4. Single page template: For pages such as "About Us" and "Contact Information", Anqi CMS provides a dedicated single-page management. These single pages can also be independently specified with templates, such as creating a template for the "About Us" page.page/about.htmltemplate file, to achieve its unique design style.

  5. Mobile exclusive template:To adapt to access from different devices, AnQi CMS supports responsive design, code adaptation, or independent PC and mobile site modes. In the latter two modes, we can set up a folder in the template.mobile/Subdirectory, and place the exclusive template files for mobile devices in it, ensuring that the content is presented in the most friendly way when accessed on mobile phones.

Inside the template,Rich template tags and filtersplaying the role of a data connector. By usingarchiveDetail/pageDetailTags, we can easily extract all standard fields such as the title, content, images, and publishing time of documents from the database. What's more powerful is thatarchiveParamstags or directly through{{archive.自定义字段名}}The way, we can accurately display the various custom fields (such as "product price", "inventory quantity", "author") defined in the content model on the page.

In addition, these tags support a variety of flexible parameters and filters to further beautify and process data:

  • Image processing: {{archive.Logo}}Can obtain the document cover image, and{{item.Images}}(Used for group images) andthumbThe filter can easily display thumbnails or process image size.
  • Content rendering: {{archive.Content|safe}}Used to safely render rich text content, to prevent HTML tags from being escaped. If the document content is in Markdown format,renderThe filter can also help us convert it into beautiful HTML.
  • Date format: stampToDateTags can convert the timestamp into the date and time format we need, for example:{{stampToDate(archive.CreatedTime, "2006-01-02")}}.
  • Logical control and loops: ifTags can be displayed or hidden based on conditions,forLoops can iterate through image groups, related product lists, etc., to achieve dynamic layouts.

By the collaborative effect of these functional points, whether it is to display product details with specific price parameters or to present a layout unique activity introduction, AnQi CMS can help us achieve highly personalized content display, so that each document can be displayed in the most suitable way for its content characteristics in front of users.


Frequently Asked Questions (FAQ):

  1. How can I make the detail page layout of my "news" model and "product" model completely different? Answer:You can create or modify them separatelynews/detail.htmlandproduct/detail.htmlThese models default templates. In the background content model management, ensure that the "news" model and the "product" model are each associated with their corresponding table names and URL aliases, and then the system will automatically render the documents of these two models separately to the different templates you design.

  2. Ask: How can I display the additional information such as the material and warranty period that I have added for the product on the product details page? Answer:First, find your "product" model in the content model management, add custom fields named "material" and "warranty period". Then on the product detail page template (for exampleproduct/detail.htmlIn it, you can use{% archiveParams params %}Label to iterate and display all custom parameters, or use it directly{{archive.材质}}and{{archive.保修期}}To accurately call the values of these fields.

  3. Ask: If I have a very important product, can I make its detail page use a unique layout instead of the general layout of its category or model? Answer:Can. When editing the specific product document, find the 'Document Template' field, and fill in the template filename you have designed separately for this document (for examplevip_product_detail.html). Make sure thisvip_product_detail.htmlThe file exists in your template directory and the system will use it to render this special document first.