Does AnQiCMS support displaying different detail page styles based on different content models?

Calendar 👁️ 73

In website operation, we often encounter such needs: different types of content, even on the same website, need to have completely different display styles.For example, a product detail page of an e-commerce website needs to highlight product images, prices, inventory information, etc., while the blog article detail page may focus more on the reading experience, author information, and publication date.This ability to customize the style of detail pages based on content type (or content model) is crucial for improving user experience and content professionalism.

Can we achieve such a fine-grained content model matching with the detail page style when using AnQiCMS?The answer is affirmative, and AnQiCMS is very flexible and powerful in this aspect.

The powerful foundation of content models

One of the core strengths of AnQiCMS is its 'flexible content model' feature.The system includes common content types such as 'Article Model' and 'Product Model', and it also allows users to completely customize new content models according to their business needs.For example, you can create a "case model" to showcase company projects, or a "campaign model" to publish marketing promotion content.

Each custom content model is not just a name; it also defines the unique fields of this type of content.For example, a product model can have fields such as "price", "inventory", "brand", etc., while an article model may have fields such as "author", "source", "recommendation level" etc.These customized fields are the foundation for differentiated detail page styles, as they determine which data can be called and displayed in the template.

The core mechanism of customizing the detail page style

The key to AnQiCMS displaying different detail page styles for different content models lies in its intuitive and powerful template naming conventions. In the root directory of AnQiCMS templates (/templateUnderneath, we can create a dedicated folder for each content model and place the corresponding detail page template files in these folders.

In particular, the system will search for the corresponding template based on the content's 'model table name'. For example:

  • For content published through the 'Article Model', AnQiCMS will default to searching for the location of/template/{你的模板目录}/article/detail.html.
  • And for content published through the 'Product Model', it will search for/template/{你的模板目录}/product/detail.html.

This means that we just need to create corresponding folders for different content models (the folder names are usually consistent with the English table names of the models) and design their respectivedetail.htmlTemplates can allow articles to have their layout, products to have their style, and not affect each other.This convention is greater than configuration design, which greatly simplifies the process of template development, allowing us to focus on the design itself without the need for complex background association settings.

More granular control

AnQiCMS's flexibility is not limited to the model level. If we encounter a specific article, product, or page that needs a unique display under the same content model, it also provides a solution.

When editing a single document (such as an article or product) in the background, we will find a 'Document Template' setting option. Here, we can specify a separate template file for this particular document, for examplecustom_article_detail.html. The system will use this specified template first, covering the default detail page style of the content model it belongs to, thereby meeting the need for more personalized display.

This flexible customization capability also extends to category pages and single pages:

  • Category template:We can set a dedicated list page template for a specific category (for example{模型table}/list-{分类ID}.html),Let the content lists of different categories present different styles.
  • Single page template: For pages such as "About Us", "Contact Us", etc., independent template files can also be specified when editing in the background (for example,page/about.htmlMake sure that these special pages also have a customized appearance.

Dynamic presentation of template content

How do we dynamically load and display content in the dedicated detail page templates designed for different content models?The AnQiCMS template tag system (using Django template engine syntax) provides powerful support.

ByarchiveDetailTags, we can easily obtain all standard field information of the current document, such as the title (Title), content (Content),release time(CreatedTime)Etc. What is even more surprising is that the custom fields defined in the content model, such as 'price' and 'stock' in the product model, or 'article source' in the article model, can be directly displayed in the corresponding detail page template through simple tag calls.This means that your product detail page can easily display the various parameters of the product, as well as the article details

Related articles

How to use AnQiCMS to customize the display layout of the article detail page?

AnQiCMS provides a very flexible and powerful content management system, allowing us to easily customize the display layout of article detail pages.In order to enhance user experience, optimize SEO, or better showcase the brand characteristics, AnQiCMS can help us achieve these goals through its intuitive template system and rich tag features.How can we proceed specifically? We can delve into these aspects step by step.### 1. Understanding AnQiCMS template mechanism First

2025-11-09

How to display or customize the error pages (such as 404, 500) and shutdown notifications of a website?

In the operation of the website, visitors may encounter pages that cannot be found for various reasons or temporary issues with the server, and may even be unable to access the website during maintenance and upgrades.In these situations, a well-designed error page (such as 404, 500) and a friendly shutdown prompt can not only greatly improve user experience but also maintain the professional image of the website to a certain extent and search engine optimization (SEO).AnQi CMS is an efficient content management system that provides a flexible way to display and customize these important pages.###

2025-11-09

How to display the list of dynamic Banner images configured in the website?

The website's banner area, like a dynamic promotional window, its visual appeal and content delivery efficiency directly affect the first impression of visitors to the website.A well-designed Banner that can quickly capture the user's attention and effectively showcase the brand image, latest activities, or core products.In AnQiCMS (AnQi CMS), by utilizing its powerful content management features, you can easily configure and display a dynamic banner image list, keeping your website fresh and attractive.###

2025-11-09

How to add hreflang tags in templates to support multi-language SEO?

With the increasing trend of globalization, many websites are facing the challenge of providing content to users of different languages or regions.To ensure that your multilingual website performs well in search engines and accurately guides users to their preferred language version, adding the `hreflang` tag is crucial.AnQiCMS (AnQiCMS) is an enterprise-level content management system that deeply supports multilingualism and provides a convenient way to implement this feature in templates.### Understand the role of the hreflang tag `hreflang`

2025-11-09

How to display only articles of specific categories in the article list?

When managing website content in Anqi CMS, we often need to flexibly control the display of article lists, for example, only displaying articles under specific categories on a certain page.This not only helps to organize the content of the website accurately, but also greatly improves the browsing experience of visitors, helping them find the information they are interested in faster.AnQi CMS provides powerful template tag features, making this requirement simple and intuitive.The core of achieving this goal lies in the `archiveList` template tag of Anqi CMS.This tag is used to obtain the 'universal key' for the article list from the database

2025-11-09

How to configure AnQiCMS to enable lazy loading of images on the page?

In today's rich network world, the speed of website loading is of great importance to user experience and search engine optimization (SEO).Especially when a page contains a large number of images, how to effectively manage the loading of these images, avoid the lag caused by loading all resources at once, has become a focus of many website operators.The Lazy Load (Lazy Load) technology is the tool to solve this problem, it allows images to be loaded only when the user is about to see them, thus significantly improving page performance.AnQiCMS as a high-performance content management system

2025-11-09

How to use template tags to dynamically display the associated Tag list in article content?

How can we make users see the related keywords or topic list in an article at a glance while browsing, so as to guide them to discover more interesting content and thus improve user experience and website stickiness, which is an important link.AnQiCMS (AnQiCMS) provides powerful template tag features, allowing you to easily display related Tag lists dynamically in article content, which is both beautiful and practical.**Understanding the Tag Function of AnQi CMS** Tags in AnQi CMS are not just simple classifications of articles

2025-11-09

How does the multi-site feature of AnQiCMS affect the display and switching of front-end content?

When using a website content management system, the multi-site feature has always been a topic of concern.It not only concerns the operational efficiency, but also directly affects the organization, display of website content, and the smooth switching experience of users between different sites.For AnQiCMS users, its powerful multi-site feature is the tool to solve these challenges.Let's delve into how the multi-site feature of AnQiCMS affects the display and switching of front-end content.One of the design初衷 of AnQiCMS is to meet the needs of users managing multiple brands, sub-sites, or multilingual content

2025-11-09