In website operation, content is not only the information itself, but also the way it is presented is equally important.Set unique display layouts for different types of content (such as news, product introductions) can greatly enhance user experience, strengthen brand image, and even have a positive effect on search engine optimization (SEO).AnQiCMS (AnQiCMS) provides very flexible and powerful features in this aspect, allowing you to easily create exclusive visual styles for various types of content.

Content Model: The Foundation for Layout Customization

Auto CMS first lays a structured foundation for different types of content through the concept of 'Content Model'.Imagine a typical news article, which may only need fields such as title, content, publication date, and author; while a product detail may require more specific information such as product name, multi-angle images, price, detailed parameters, and purchase links.

In the AnQi CMS backend, you can define a set of fields for 'Articles', another set for 'Products', and even create custom models to adapt to more unique business needs.This fundamental difference in data structure naturally guides us to adopt different layouts when designing on the front end to optimally display the characteristics of each type of content.This flexible content model design of AnQi CMS is the first step in our implementation of diverse content display.

Template system: The core of diversified display

When we have a structured content model, the next step is how to present these contents in the way we expect.The AutoCMS adopts an intuitive and powerful template system..htmlwith suffix, stored intemplateSpecific template folders under the catalog.

The template system of Anqi CMS supports syntax similar to Django template engine, which allows content operators or front-end developers to get started quickly. The system itself provides default template conventions for different content models, for example, the detail page of an article model may use the default template.article/detail.html, and the list page of the product model may useproduct/list.html. This has provided a basic distribution layout for different content types.

However, the strength of AnQi CMS is not limited to this. It allows you to customize and override templates at a more fine-grained level, which is the key to achieving a 'unique display layout':

  • Category-level customization:If you have a "Science and Technology NewsSimilarly, you can also specify a uniform "document template" for all articles under this "Science and Technology News" category, ensuring they maintain a consistent visual sense of science and technology.list-科技新闻.htmlSpecify for documents under this category:tech_detail.html).

  • Customization at the individual article or product level:Sometimes, you might have an extremely important news report, or a flagship product, which requires a unique and even transcending category limits dedicated display page.Auto CMS provides this ultimate flexibility.When publishing or editing a single document (article or product), you can directly specify a dedicated template file for this specific content in the 'Document Template' field.This means that even if it belongs to a category with a universal template, the template specified for the single piece of content will take precedence and allow your key content to have a completely personalized display stage.

  • Page-level customization:In addition to articles and products, websites usually also have independent single pages such as "About Us" and "Contact Information".These pages often carry important brand information and need careful design.The 'Page Management' also provides the 'Single Page Template' setting in 'Ananqi CMS'.page/10.htmlor a custom-named template, thereby endowing it with a unique design style.

This multi-level template overlay mechanism allows the Safe CMS to perfectly adapt to all kinds of layout customization needs from macro to micro.The system will intelligently judge: Is a template specified for the current single content?If not, has a template been specified for the category of the content?If it is still not available, it will fall back to the default template of the content model.This priority rule ensures that you can always control the presentation of content in the most refined way.

Flexible data retrieval and display

After specifying unique templates for different content types and levels, how to accurately call and display corresponding data in these templates is also very important.The template tag system of Anqi CMS makes this process very convenient.

No matter how beautifully you have set up the card layout for news articles or how intricately you have designed the图文排版 for product details, you can use such asarchiveDetail(Document Details),pageDetail(Single page details) and other tags, easily obtain all content fields of the current page, including title, text, images, custom parameters, etc. For list pages,archiveListandcategoryListLabels can help you filter and display content summaries as needed.

It is more important that if you define "custom fields" in the content model, such as the "material" and "applicable population" of the product model, these fields can also bearchiveParamsTags are convenient to call and display in templates with unique layouts, ensuring that every content element is presented properly.

Through these features of AnQi CMS, you can easily create a concise and efficient reading experience for news articles, provide an intuitive and rich visual impact for product display, and create a professional and stable brand image for the company introduction page.This is aimed at helping your website stand out in the information deluge and reach your target audience in the most attractive way.


Common Questions (FAQ)

1. Where should I place the custom template file in the Anqi CMS?

The custom template file should be placed intemplateThe directory under which you are currently using the template folder. For example, if the name of the template folder you are using isdefaultThen you can organize according to content type and priority. For example, for a document with a specific ID under the article model, you can createarticle/detail-{文档ID}.html. For a list page of a certain category, you can createarticle/list-{分类ID}.html. For a single page, you can placepage/{单页ID}.htmlOf course, you can also specify a custom name directly in the background, as long as the file exists in your template folder.

2. If I set both a category template and a single document template for a content, which one will take effect?

When choosing a template, Anqi CMS will follow a priority rule: first, it will check if it is for this specific article.a single documentSpecified the template, if any, it will be used preferentially. If not specified, it will look up the content it belongs to upwards.CategoryWhether a template has been specified. If the category has not been specified either, it will fallback to the content's category last.Content ModelThe default template. In short, the template specified for a single document has the highest priority.

3. How to set up completely different page structures and styles for my "product display" and "news information" content?

The AnQi CMS has already implemented this distinction at the content model level.The system usually defaults to built-in “article model” and “product model”./template/你的模板目录/Createarticle/andproduct/folders, and place each one separately.detail.htmlandlist.htmlTemplate.Here, the article and product pages will automatically use their respective independent template files, thus having completely different page structures and styles.You can even introduce different CSS and JS files in these two templates to achieve a complete visual difference.