When using the 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 personalization settings.This is not just a simple change of text color or font size, but also a deep customization from content structure to presentation.
The foundation of individualized display isContent model and custom fields.安企CMS allows us to create different content models based on actual business needs, such as 'articles', 'products', 'news', and even 'cases' etc.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 dimension of the document, providing data support for subsequent personalized display.
Next,Flexible application of templatesThe key to personalized presentation. Anqi CMS provides multi-level template customization capabilities:
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 for it (usually
{模型table}/detail.htmlfor examplearticle/detail.htmlorproduct/detail.html)。Thus, all documents belonging to this model will automatically adopt this template for display. If the product requires a special layout, just modifyproduct/detail.html,and it will not affect the display of the article.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 require more promotional information.This is where 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 under this category (regardless of their model, but ensuring that the template content is adaptable) to use this dedicated template.
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 creatinga single documentSpecify an independent template. When editing a document, just enter the filename of the custom template in the "Document Template" field (for example,
download.html),System will prioritize using this template to render the detailed content of the document, with a higher priority than the category and model templates.Single Page Template:For static pages such as "About Us" and "Contact Information
page/about.htmlThe template file, implementing its unique design style.Exclusive template for mobile:In order to adapt to different device access, Secure CMS supports responsive design, code adaptation, or independent site modes for PC and mobile. In the latter two modes, we can set up a
mobile/Subdirectory, and place the dedicated 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 filtersacting as 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,archiveParamstags or directly through{{archive.自定义字段名}}The way, we can accurately present various custom fields (such as "Product Price
Additionally, these tags support various flexible parameters and filters to further beautify and process data:
- Image processing:
{{archive.Logo}}Can obtain the document cover image,{{item.Images}}(for group images) andthumbThe filter can easily achieve the display of thumbnails or the processing of image size. - Content rendering:
{{archive.Content|safe}}Used to safely render rich text content, to avoid HTML tags from being escaped. If the document content is in Markdown format,renderThe filter can also help us convert it into beautiful HTML. - Time format:
stampToDateTags can convert timestamps into the date and time format we need, for example:{{stampToDate(archive.CreatedTime, "2006-01-02")}}. - Logical control and loops:
ifThe label can display or hide some content based on conditions,forLoops can traverse image groups, related product lists, etc., to achieve dynamic layout.
Through the collaborative effect of these functional points, whether it is to display a product detail with specific price parameters or present an activity introduction with a unique layout, AnQi CMS can help us achieve highly personalized content display, allowing each document to be presented to the user in the most fitting way for its content characteristics.
Frequently Asked Questions (FAQ):
问:How can I make the detail page layout of my “news” model and “product” model completely different? Answer:You can create or modify them separately
news/detail.htmlandproduct/detail.htmlThese two models are the default templates.In the background content model management, make sure that the "News" model and the "Product" model are each associated with their corresponding table name and URL alias. After that, the system will automatically render the documents of these two models separately into the different templates you have designed.问:How can I display the additional 'material' and 'warranty period' information I have added for the product on the product detail page? Answer:First, find your "Product
product/detail.html), you can use{% archiveParams params %}Translate tags to traverse and display all custom parameters, or use them directly.{{archive.材质}}and{{archive.保修期}}To accurately call the values of these fields.问:If I have a very important product and I want its detail page to use a unique layout instead of the general layout of its category or model, is it possible? Answer:Can. When editing the document for this specific product, find the "Document Template" field, and enter the filename you have designed for this document separately (for example
vip_product_detail.html). Make sure that thisvip_product_detail.htmlThe file exists in your template directory, and the system will use it to render this special document first.