How to customize the display layout of the website page in AnQiCMS?

Calendar 👁️ 77

AnQiCMS provides very flexible and powerful custom capabilities for website page display layout.Whether you want to quickly build a corporate website with a unique style or need to operate multiple site contents with precision, AnQiCMS can give you the freedom to control everything from the 'skeleton' to the 'flesh' of the website.

Core concept: Comprehensive control from skeleton to detail

The customization capabilities of AnQiCMS are mainly reflected in the use of the Django template engine syntax, which is natural and smooth, easy to learn, and even if you are not a professional backend developer, you can control the display of page elements through simple tag labels.It decouples the display logic of the website from the data content, allowing you to focus on frontend design without worrying about the complexity of the underlying code.

AnQiCMS template files are unified in use.htmlas a suffix, and stored in the root directory/templatefolder. Each template package has aconfig.jsonFile used to define the template name, version, author, and other basic information, the most critical of which istemplate_typefield, which determines whether your website is usingAdaptive/Code AdaptationOrPC+mobile independentThe display mode. This means you can choose the most suitable layout strategy based on the target audience and device type.At the same time, the static resources such as CSS, JS, and images required by the template also have clear storage paths./public/static/It facilitates management and maintenance.

Organization and refinement of template files: the foundation for creating exclusive pages.

In AnQiCMS, the organization structure of template files is very clear, which can be adopted.Folder organization modeorFlat file organization modeThese two patterns are designed to help you efficiently manage and search for templates.

For example, you can place common code segments that all pages need to inherit, such as page headers and footers.bash.htmlChinese; Place reusable code snippets such as sidebars and breadcrumb navigation inpartial/the directory for easy reference between pages.

For common page types, AnQiCMS also presets some default template file names, as long as you create these files, the system can automatically recognize and apply them:

  • Home: index/index.htmlorindex.html
  • Document Details Page: {模型table}/detail.htmlFor example, the article model isarticle/detail.html)
  • Document List Page: {模型table}/list.html
  • Single page detail page: page/detail.html
  • Search Page: search/index.html
  • Error page: errors/404.htmlorerrors/500.html

It is especially worth mentioning that AnQiCMS allows you to specify a unique template for specific content (such as a category, an article, or a single page). For example, if you want the 'About Us' single page to have a completely independent design, you just need to name its template file aspage/about.htmlThen, when creating a single page in the background, specify the use of this custom template. Similarly, category pages can also be accessed through{模型table}/list-{分类ID}.htmlor specify a category template in the background to achieve personalized layout.

If you select code adaptation or PC + mobile mode, the system also supports in/templatecreating in the template folder under the directorymobile/Subdirectory, and copy the template structure consistent with the PC end. In this way, when the mobile device accesses, the system will automatically loadmobile/Ensure the mobile experience of the templates under the directory.

Deep customization: Content model and flexible fields

The website layout is not only static design, but also closely integrated with the content.The 'Flexible Content Model' feature of AnQiCMS is the key to deep customization.It allows you to customize different types of content according to your actual business needsData structure.

For example, an "article" model may only need a title, content, and publication time;And a 'product' model may need product name, price, inventory, image group, detailed parameters, etc.Through the backend settings, you can add various types of custom fields to each model, including single-line text, numbers, multi-line text, single selection, multiple selection, and dropdown selection, etc.These fields directly determine which information you need to fill in when publishing content, and also determine how this information is displayed on the front-end page.

In the template, you can usearchiveDetailtags to get detailed data of a single document througharchiveListtags to get a list of documents, even througharchiveParamsLabel to display custom field data. This means that you can design completely different display modules and styles for each content type.For example, on a product detail page, you can easily loop through the various custom parameters of the product to make the information display more organized.

Precise control: classification, single page and URL layout

The structure and accessibility of a website largely depend on its categorization method, single-page management, and URL structure. AnQiCMS provides a wealth of customization options in these areas:

  • Category template:You can not only set a unified list template for all categories under a certain model, but also fora specific categorySpecify a dedicated template. For example, your 'Downloads' category may need a simple list, while the 'News' category requires an abstract and thumbnail.When setting categories in the background, just enter the name of the template file you designed (for exampledownload.htmlThe category will automatically apply the new layout. It can also set template inheritance for child categories to simplify management.
  • Single page template: For independent pages such as "About Us", "Contact Us", and others, you can set their display layouts separately. Similar to category templates, in single page management, you can specify an independent template file (such aspage/about.html),let each single page have a unique design style.
  • URL layout (pseudo-static):The URL structure of the website is crucial for SEO and user experience.AnQiCMS provides powerful pseudo-static rule management functions.In addition to built-in number patterns, model naming patterns, and classification naming patterns, etc., you can also customize the URL structure.By flexibly applying the rules{id}(Data ID)、{filename}(Custom data link name)、{catname}(Custom category link name)、{module}(Model table name) variables, you can build personalized URLs that comply with specific SEO strategies and user habits. For example, set the article detail page URL to/article/{filename}.htmlor set the product list page to/product/{catname}-{page}.htmlcan make your website URL more semantically and friendly.

Navigation and blocks: flexible construction of website structure

A good website layout cannot do without clear navigation and reusable page blocks.

  • Navigation management:AnQiCMS allows you to create and manage multiple navigation categories (such as top main navigation, footer navigation, sidebar navigation, etc.) in the background "Website Navigation Settings".Each navigation item supports multi-level nesting, you can link to built-in pages, specific categories, single pages, or even external links.In the template, throughnavListLabel, you can easily retrieve and render these navigation menus, implementing complex dropdown menus or multi-level navigation layouts.
  • Reusable block: AnQiCMS advocates code reuse, throughincludeandmacroLabel, you can encapsulate commonly used code snippets (such as page headers, footers, sidebar ad slots, general article/product display styles, etc.) and then introduce them where needed.This can reduce redundant development and ensure the consistency of the website style. Especiallyextendstags, allowing you to define a basicbase.htmlAs a "master template", it contains the overall structure and common elements of the website, and other pages inherit this master template and rewrite specific

Related articles

How to use the timed publishing feature in AnQiCMS to accurately

Today, in the increasingly refined field of content marketing, both the quality of the content and the timing of its dissemination are equally important.A well-crafted content, if released at an inappropriate time, may not achieve the expected communication effect.AnQiCMS is an efficient management system designed specifically for content operators, deeply understanding this field, and its built-in scheduling publication function is the key tool to help us accurately grasp the 'golden moment' of content marketing.The core concept of the scheduled publishing function is to make content going online no longer limited by manual operation time.

2025-11-07

How to set up the website navigation menu in AnQiCMS and support multi-level dropdown display?

The website navigation is the first window for users to interact with the website, a clear and intuitive navigation design can greatly enhance the user experience and effectively guide them to find the information they need.In AnQiCMS, setting up the website navigation menu and supporting multi-level dropdown display is a flexible and practical feature.Next, we will explore how to achieve this goal in AnQiCMS together. ### Build the backend logical structure of the website navigation To create and manage the navigation menu in AnQiCMS, you need to enter the "Navigation Settings" area of the backend.

2025-11-07

How to add thumbnails to articles and products on the AnQiCMS website and control their frontend display styles?

Managing website content in AnQiCMS, thumbnails are undoubtedly an important element in enhancing user experience and page attractiveness.Whether it is an article that attracts users to click or a detailed page that showcases product features, a suitable thumbnail can play a huge role.What is even better is that AnQiCMS provides an intuitive backend operation and flexible template tags, allowing us to easily add thumbnails to articles and products and finely control their display styles on the front end.

2025-11-07

What types of document list display does AnQiCMS support, and how to filter content by category or model?

When using a content management system, efficiently displaying and organizing various types of information is the key to improving website user experience and operational efficiency.AnQiCMS provides very flexible and powerful features at this point, not only supporting multiple types of content list display, but also allowing content filtering through various dimensions to help users accurately present information. ### Diversified Content List Display: Beyond Traditional Article Lists One of the core strengths of AnQiCMS lies in its 'flexible content model'.

2025-11-07

How to use AnQiCMS template tags to flexibly display different types of content?

AnQiCMS as an efficient and flexible content management system, its template tag system is the key to our website content operation and display.It provides a set of intuitive and powerful tools that allow us to present the content of the backend management in various styles according to different scenarios and needs, thereby greatly enhancing the flexibility and user experience of the website.

2025-11-07

What template file types and organization modes does AnQiCMS support to control the display of the page?

## AnQiCMS template files and organization methods: The secret to flexible control of page display In the digital age, the visual presentation and content layout of a website are the core of attracting users and conveying information.An excellent content management system should also provide highly flexible page display control capabilities, in addition to powerful content management functions.AnQiCMS is designed based on such an idea, it not only makes content publishing efficient, but also gives users the powerful ability to customize the appearance of the website at will through its unique template file type and organizational mode.

2025-11-07

How to create and manage multiple sites in AnQiCMS to achieve independent content display?

AnQiCMS is an efficient enterprise-level content management system, and its multi-site management function is undoubtedly an important tool for many enterprises and operators to improve efficiency and segment the market.By creating and managing multiple independent sites under an AnQiCMS instance, we can flexibly provide customized content display and services for users of different brands, business lines, or regions.

2025-11-07

How does AnQiCMS handle images in document content to optimize front-end display (e.g., Webp, compression)?

Images are an indispensable part of website content, they can make the page more attractive and convey richer information.However, if images are not optimized, the large file size often leads to slow website loading, severely affecting user experience and search engine rankings.AnQiCMS provides a series of powerful optimization functions when processing images in document content, helping us easily cope with these challenges to ensure that the front-end display is both beautiful and efficient.

2025-11-07