How to customize the front-end content display layout of Anqi CMS website?

Calendar 👁️ 75

AnQiCMS provides highly flexible front-end content display layout customization capabilities, allowing the website to present unique visual effects and information structures according to specific needs.This not only concerns the appearance of the website, but also lies in how to convey content efficiently and accurately to visitors.By understanding the template mechanism and various functions of AnQiCMS, users can easily achieve fine-grained control from the overall theme style to the display of individual content.

The template is the core of front-end layout

In AnQiCMS, the front-end layout of the website is mainly implemented through templates (Templates). These template files are usually in.htmlWith the suffix, they are stored uniformly in the system's/templatedirectory. Each website theme has an independent template folder, which includes oneconfig.jsonThe file defines the name, type, and other basic information of the topic.AnQiCMS uses a syntax similar to the Django template engine, which allows users familiar with web development to quickly get started.{{变量}}), conditional judgments ({% if %})、looping over({% for %}A variety of control structures provide strong support for dynamic content display.

On the template type, AnQiCMS provides three modes: adaptive (responsive), code adaptation, and independent PC + mobile sites.This means that no matter what type of device your website's target users mainly use, you can find an appropriate template strategy to optimize their access experience.

Customize the level and method of content display.

AnQiCMS's front-end layout customization can be expanded from multiple levels:

  1. Switch the overall site theme and layout:Imagine your website as a stage, and the template is the overall scenic design of this stage.By selecting different template themes in the background, you can switch the overall style and layout of the website with one click.config.jsonFile, defines the characteristics of the theme. If you want to develop a completely new theme, just create a new folder under/templatedirectory and organize the files according to the conventions.

  2. Page-level general layout adjustment:Each page type on the website (such as the homepage, article list page, article detail page) has its corresponding template file. For example,index/index.htmlCorresponding to the homepage,{模型table}/detail.htmlContent detail page,{模型table}/list.htmlContent list page. To improve the reusability of the template, you can extract the commonly used parts such as header, footer, sidebar, and place them inpartial/Under the directory, then pass through where needed{% include "partial/header.html" %}Reference the label easily. This modular design makes maintenance and updates more efficient.

  3. Content model and deep customization of custom fields:The strength of AnQiCMS lies in its 'flexible content model' feature.It allows you to create or modify content models based on business needs, not just limited to traditional articles and products.You can define unique fields for each content type (such as news, products, cases, services, etc.), for example, add custom attributes such as 'color', 'size', 'material' to the 'product' model.{% archiveParams %}Or directly through{{archive.自定义字段名}}To call and display in this way, achieving personalized content display.

  4. Fine-grained layout control down to the layout of individual content:If you want to have a unique layout design for a specific article, a category page, or even a single page, AnQiCMS also provides such granularity control.When publishing or editing content (articles, products, single pages, categories), the backend provides options for 'document templates', 'category templates', or 'single page templates'.download.htmlThis content will no longer use the default template, but will load the file you specify to display.This allows you to provide fully customized design for some special pages (such as landing pages, event pages) without affecting the general layout of other pages.

  5. Use template tags to dynamically display data:Truly bringing the layout of the front-end to life is the rich template tags provided by AnQiCMS. These tags are the bridge connecting the template and the background data, allowing you to dynamically retrieve and display various information:

    • Global Information Tags:{% system %}Can retrieve website name, LOGO, filing number, and other global configurations;{% contact %}Can retrieve contact information;{% tdk %}Help you manage the page's SEO title, keywords, and description;{% navList %}Used to build flexible and variable navigation menus.
    • Content display tags:{% archiveList %}and{% archiveDetail %}Used for displaying articles or product lists and details;{% categoryList %}and{% categoryDetail %}Handle the list and details of category information;{% pageList %}and{% pageDetail %}Used for list and details display on a single page;{% tagList %}and{% tagDataList %}Used for displaying tags and their associated content.
    • Logical and auxiliary tags:Performing logical judgments within the template ({% if %}) or looping output ({% for %}) is equally simple and intuitive.{% pagination %}Tags can easily implement content pagination functionality,{% prevArchive %}and{% nextArchive %}Convenience in implementing the previous/next function. In addition, there is alsostampToDateUsed for time formatting, as well asinclude/extendsandmacroAnd tags, used for template reuse and structuring.
  6. Optimization of content display details:In addition to the structural layout, the visual presentation details of the content are also important.AnQiCMS provides image processing options in the content settings, such as whether to automatically convert uploaded images to WebP format to optimize loading speed, whether to automatically compress large images, and various thumbnail generation methods (proportional scaling by the longest side, padding by the longest side, and cropping by the shortest side), and allows you to customize the thumbnail size.These features can help websites improve page loading performance while ensuring visual effects.Moreover, the system is built-in with Markdown editor support, as well as through integrating third-party libraries to support the rendering of mathematical formulas and flowcharts, making the content display more diverse.

Through the above multi-level, multi-dimensional customization methods, AnQiCMS grants users great freedom, allowing them to design the website's front-end layout in a way that conforms to the brand image and meets user experience, thus better achieving the goal of website content operation.


Frequently Asked Questions (FAQ)

1. Where should I place my custom template file? What are the naming conventions for them?Your custom template file should be placed in/templateUnder the directory, each topic has an independent subfolder. AnQiCMS follows a set of conventions to match template files:

  • Public code snippets: Can be placed in the topic folder.partial/In the catalog, such asheader.html/footer.html.
  • Home:index/index.htmlorindex.html.
  • Content model home page:{模型table}/index.htmlor{模型table}_index.html.
  • Document list page:{模型table}/list.htmlorlist-{分类ID}.htmlCan also bepage/{单页面ID}.html. *

Related articles

How does AnQiCMS's `filter` tag combine multiple filters to process content in a chain?

AnQiCMS provides flexible and powerful content management capabilities, among which the template engine is the core of our daily operations and content display.When processing website content, we often encounter situations where we need to perform multi-step transformations to achieve the final display effect.For example, a long article summary may need to be truncated first, then ensure all letters are lowercase, and finally calculate the length of the processed text.If each time is handled manually through complex code logic, it is not only inefficient but also makes the template difficult to maintain.

2025-11-08

What search engines does the "Link Push" feature of AnQiCMS backend support for active push?

Today, with the rapid growth of internet content, the quick inclusion of website content is an important factor in increasing website traffic and influence.For many content operators and enterprises, how to make search engines discover and index new content on their websites in a timely manner is a core issue in SEO work.AnQiCMS (AnQi CMS) deeply understands this need, especially in the backend, integrating a convenient and powerful "link push" function, aimed at helping users deliver their carefully crafted content to major search engines in the shortest possible time, effectively shortening the cycle from content publication to indexing.###

2025-11-08

How to use the `length` filter to get the length of a string, array, or key-value pair in AnQiCMS templates?

In AnQiCMS template development, we often need to process and judge the data displayed on the page.Among them, getting the length of a string, array, or key-value pair is a very basic and practical operation.The AnQiCMS template engine provides the `length` filter, making this task simple and intuitive. ### Understanding the `length` filter: A tool for getting data length The `length` filter, as the name implies, is used to get the 'length' of the data.

2025-11-08

How do the `urlize` and `urlizetrunc` filters handle URL links in the AnQiCMS template?

In website operation, we often need to embed various links in the content, whether they point to internal resources or external references.Manually converting plain text links into clickable hyperlinks is not only inefficient but also prone to errors.It is more important that standardized link handling is crucial for search engine optimization (SEO) and user experience.

2025-11-08

How can AnQi CMS be configured and display multilingual content to expand the international market?

Expand the international market, allowing your content to reach global users is an important part of many enterprises' digital strategies.AnQiCMS (AnQiCMS) is well aware of this need and therefore built-in strong multilingual support and multi-site management capabilities from the very beginning, helping users efficiently configure and display multilingual content. ### Embarking on the journey of internationalization: The cornerstone of multilingual support AnQi CMS is committed to providing small and medium-sized enterprises and content operation teams with an efficient and flexible content management platform.

2025-11-08

How to optimize the URL structure of Anqi CMS to improve search engine results?

In the world of digital marketing, a website's URL is not just a string of addresses; it is also the key for users and search engines to understand the content of the web page.A well-optimized URL structure not only enhances user experience but also significantly improves the website's crawling and ranking performance by search engines.For those who operate websites using AnQi CMS, using the powerful functions provided by the system to optimize the URL structure is an important step to improve the display effect of search engine results.Why is optimizing URL structure so important?

2025-11-08

How to set an independent display template for a specific page or content block in AnQi CMS?

In the daily operation of Anqi CMS, we often encounter such needs: certain pages or content need to break away from the unified style of the website and present in a unique way.This could be to highlight an important product, create a dedicated landing page for a special topic event, or simply make the "About Us" page more brand-specific.

2025-11-08

How to ensure that the AnQi CMS website displays content normally on PC, mobile, or adaptive mode?

When building and operating a website, the display effect of content on different devices is crucial to the user experience.AnQiCMS provides a variety of mechanisms and rich features to help users easily cope with the challenges of content display on PC, mobile, and various adaptive scenarios.Understanding and appropriately utilizing these features can effectively ensure that your website content is presented normally and beautifully on any screen.--- ## One, understand the responsive and adaptation mechanism of AnQiCMS AnQiCMS provides flexible options in website modes

2025-11-09