How to customize the display layout and style of AnQi CMS

Calendar 👁️ 61

Customizing the display layout and style of website content in Anqi CMS is an indispensable part in building a beautiful and efficient website.The system provides a rich set of tools and flexible mechanisms, allowing users to fully control the visual presentation of the website from content structure, template selection to detailed style.

The cornerstone: Flexible content model and customized backend

The display of website content first depends on its inherent structure.One of the advantages of AnQi CMS is that it provides the 'flexible content model' feature.This means you are not limited to publishing only 'articles' or 'products' as general types, but can create any number and type of 'content models' based on your business needs.For example, you can create independent content models for 'events', 'case studies', 'team members', and so on.

When defining these models, you can add various custom fields to them.For example, a "product" model can have fields such as "priceThese custom fields are not only convenient for you to enter and manage content in the background, but more importantly, they are the basis for displaying personalized layouts on the front end.You can easily retrieve the data of these fields and display them in various corners of the website.

Moreover, AnQi CMS also allows for customized management of categories and single pages.Each category can have an independent introduction, SEO information, even a Banner image and a custom template; single pages (such as "About Us

Unlock visual presentation: Various template structures and adaptive modes

AnQi CMS strictly separates content and display logic, all the layout and style of the front-end pages are controlled through template files. These template files are uniformly stored in the root directory of the system./templateIn the folder. Each independent template will have its own dedicated directory and contain aconfig.jsonfile to define the basic information and type of the template.

On template organization, the system provides two main modes: "folder organization mode" and "flattened file organization mode". These two modes are designed to help you better organize and manage a large number of template files:

  • Folder organization mode: Tend to divide the directory according to the functional modules of the website (such as the homepage, model page, detail page, list page) to make the structure clear and easy to search. For example,/index/index.htmlUsed for the homepage,{模型table}/detail.htmlUsed for document detail pages.
  • Flat file organization modeThen all the main page templates are placed directly in the template root directory, distinguished by naming conventions (such asindex.html/{模型table}_detail.html), which may be more convenient for small websites or developers who are accustomed to flat structures.

No matter which mode you choose, you can specify a specific template file for different content types, even for a specific document, category, or single page. For example, specify a template file for the "About Us" page.page/about.htmlTemplate, or specify for a product categoryproduct/list-special.htmlTemplate, thus achieving highly personalized page layout.

For access needs of different devices, Anqi CMS is built-in with multiple website modes: adaptive, code adaptation, and PC + mobile independent site mode. Among them, if you choose code adaptation or PC + mobile independent mode, you can create a template in the template directory.mobileSubdirectory, storing templates specifically designed for mobile devices, ensuring that there is also **a good browsing experience on small screen devices.

Precise content control: powerful template tag system

Present the data from the background on the front-end page, AnQi CMS provides a powerful and flexible template tag system.These tags are like bridges connecting backend data with frontend display, allowing you to easily retrieve the required information and format it with preset styles.

  • Global Information Tag::LikesystemThis tag can retrieve the website name, Logo, copyright information, etc.;contactThis tag can retrieve contact information, phone number, address, etc.;tdkThe tag is responsible for outputting the page title, keywords, and description (TDK) information, which are key elements for website SEO and user experience.navListandbreadcrumbTags are used to build the website's navigation menu and hierarchical breadcrumb navigation.
  • Content list and detail tagsThis is the key to displaying the core content of the website.archiveListTags allow you to flexibly obtain lists of various contents such as articles, products, and support multiple filtering and sorting methods. Whether it's the hot recommendations on the homepage, the latest releases in the sidebar, or the detailed lists on the category page, it can be realized through it. AndarchiveDetail/pageDetail/categoryDetailTags that focus on displaying complete information about a single content, including title, content, images, and custom parameters. In addition, there are alsoprevArchiveandnextArchivetags that make it easy for you to navigate between articles.
  • Dynamic Data and Interactive Label:archiveParamsTags can dynamically display various custom parameters you define in the content model, such as product specifications, author information, etc., greatly enhancing the richness of the content.archiveFiltersThe label provides support for complex filtering functions, such as multi-dimensional filtering by price, attributes, etc. in the product list, helping users quickly find the information they need.linkListTags are used to display friendship links,commentListandguestbookTags are used separately to display comment and message forms, facilitating user interaction.
  • Logical and structural control tags: To make the template more expressive, the system is built-inifLogical judgment andforLoop through tags, you can decide whether to display content based on the existence of data or whether it meets specific conditions, or loop to output list data.withTags can define temporary variables in templates, which improves code readability.includeandextendsTags also support modular development and inheritance in templates, helping you build reusable, easy-to-maintain template structures.

The details: fine-tuning of style and content presentation

In addition to the macro layout and data retrieval, AnQi CMS also provides the possibility of customization and optimization in many details, making your website visually and functionally more perfect.

  • Content editing and Markdown: When content is published, the rich text editor provides rich style tools.For users accustomed to Markdown, the system also provides Markdown editor support.archiveDetail/pageDetailortagDetailYou can also use tags to retrieve content whenrender=trueThe parameter indicates that the system should automatically render Markdown content into HTML to ensure the accuracy of the front-end display.
  • Image processing and optimizationThe visual appeal of a website cannot do without high-quality images.The AnQi CMS supports features such as automatically generating thumbnails, automatically compressing large images, and converting to WebP format when uploading images.You can set a uniform thumbnail size and processing method in the background, and can also upload multiple images or set a cover thumbnail for specific content (such as document images, category banners, single-page slideshows), and flexibly retrieve them through template tags to achieve various display effects such as galleries and slideshows.In addition, the images in the document content also support "lazy loading" configuration, which helps to improve page loading speed.
  • URL and pseudo-staticsThe URL structure of a website is crucial for user experience and SEO.The AnQi CMS provides powerful static rule management features, you can choose from a variety of preset URL patterns, or completely customize the composition of the URL, such as including model name, category name, ID, or custom filenames, making your website links more friendly and standardized.
  • Data formatting and filtersIn the template, when displaying data, you may need to perform text truncation, date formatting, number conversion, and other operations. Anqi CMS is built-in with a variety of filters (Filters), such assafeUsed for safe HTML content output,truncatecharsUsed for truncating strings and adding an ellipsis,stampToDateUsed for formatting timestamps,addUsed for adding numbers or strings,replaceUsed to replace specific content in strings. These filters allow you to finely control the display style of data at the template level without writing complex code.

By these functions and mechanisms, Anqi CMS gives you a great degree of freedom to customize the layout and style of website content.From the organization of content in the backend to the template rendering in the frontend, every link aims to enable you to build a unique, user-demanding, and visually appealing website efficiently and conveniently.


Frequently Asked Questions (FAQ)

  1. How to apply different template styles to specific articles or categories?You can edit articles or categories in the background, find the 'Other Parameters' option in the 'Document Template' or 'Category Template' option. Here you can enter the name of your custom template file (for examplespecial-article.htmlorcategory-download.html)

Related articles

How to display different types of data (such as) through the AnQi CMS custom content model?

When building a website, we often encounter situations where the content is not just simple 'articles' or 'products'.The traditional website content management system is often limited to a few predefined content types, which seems inadequate when facing diverse information display needs.AnQiCMS (AnQiCMS) is well-versed in this field, providing you with a powerful tool for easily handling various data displays through its flexible custom content model function.

2025-11-08

How to ensure that watermarks and anti-crawling interference codes are automatically added when images are displayed in the Anq CMS?

In today's era of digital content prosperity, the copyright protection and prevention of content being maliciously collected has become an important issue that every website operator cannot ignore.Handcrafted images and content, without protection, are easily copied by dishonest elements with a single click, not only damaging the creators' labor but also affecting the authority and brand value of the website.

2025-11-08

What website modes (adaptive, PC+Mobile) does AnQi CMS support to display content?

In the era of multi-screen interconnection, how website content adapts to different devices directly affects user experience and the efficiency of information dissemination.AnQi CMS fully considers this requirement, providing users with a variety of flexible website content display modes, ensuring that your website can be presented in **status** on various devices such as PCs, tablets, and mobile phones, bringing visitors a smooth and comfortable browsing experience.The AnQi CMS mainly supports three core modes in content display: adaptive mode, code adaptation mode, and PC+Mobile independent site mode.These three patterns have their own focus

2025-11-08

How to take advantage of the pseudo-static function of Anqi CMS to optimize URL display for SEO?

In website operations, a clear and friendly website address (URL) not only improves user experience, but is also an indispensable part of search engine optimization (SEO).The original dynamic URL often contains complex parameters and symbols, which is not very friendly to search engine spiders and user understanding.The pseudo-static feature is exactly to convert these complex dynamic URLs into concise, readable, and static page-like URLs, thus optimizing the website's performance at both the visual and technical levels.

2025-11-08

How to set up independent template files for specific pages or content types?

In website operation, we often encounter situations where we need to design a unique display style for certain pages or content types.Perhaps the product detail page needs a more attractive layout, or some special topic article needs to break the conventional style to highlight its importance, or a single-page 'About Us' needs to showcase the brand characteristics.AnQi CMS deeply understands this personalized need, providing flexible and powerful template customization capabilities, allowing you to easily set up exclusive template files for different content, thereby achieving more refined content presentation and brand image management.--- ###

2025-11-08

What template file types and directory structures does AnQi CMS support to organize displayed content?

AnQi CMS provides high flexibility and strong organizational capabilities in content display, which is mainly reflected in its support for template file types and directory structures.Understanding these conventions and mechanisms can help you customize the appearance and content layout of the website more efficiently. ### The core structure and conventions of template files Firstly, AnQi CMS will统一存放 all template files used for front-end display in the root directory of the site under the `/template` folder.Each independent website theme or template set should have its own folder in this directory

2025-11-08

How can you reference common header, footer, or sidebar content in a template?

In the daily operation and maintenance of the website, we often encounter such situations: each page needs to include a unified header, a standard footer, or a fixed sidebar.If every page were to rewrite this content, it would not only be inefficient but also a huge amount of work to modify once.AnQiCMS (AnQiCMS) understands this pain point and therefore provides a flexible and powerful template reference mechanism to help us efficiently manage these common contents, ensuring the unity and maintainability of the website.### Overview of AnQi CMS Template Mechanism In AnQi CMS

2025-11-08

How to correctly render Markdown editor content on the frontend page in HTML?

## AQS CMS Markdown content: How to perfectly present on the front-end page?In content creation, Markdown, with its concise and efficient syntax, has been favored by a wide range of content creators.AnQi CMS knows this and therefore provides strong Markdown editor support.But how can you ensure that the Markdown content you edit in the background is rendered correctly and beautifully on the website's frontend page?Behind this involve several key links, understanding them can help you manage the website content more skillfully.

2025-11-08