How to configure Anqi CMS to support responsive design or independent mobile content display?

Calendar 👁️ 70

In the era of co-existing multiple devices, websites can adapt well to various screen sizes, whether it is PC, tablet, or smartphone, has become a basic requirement.AnQiCMS (AnQiCMS) understands this and provides a variety of flexible configuration options to help you easily implement responsive design or independent mobile content display, ensuring that your content provides a high-quality browsing experience on any device.

The Anqi CMS provides three main website modes to support multi-terminal display: adaptive, code adaptation, and independent PC + mobile sites.Each pattern has its unique application scenarios and configuration methods, next, we will delve into them one by one.

1. Use adaptive mode, one design goes all the way

(Responsive Design) is the most common and easiest multi-terminal display solution currently.It refers to a website using a set of HTML structure and CSS styles, through technologies such as media queries (Media Queries), automatically adjusts layout, image size, and text formatting according to the screen size and resolution of the user's device, to adapt to different display environments.

How to configure:

Enabling adaptive mode in Anqi CMS is very straightforward. You usually just need to find the/template/defaultfolder you are currently using as a template (for exampleconfig.jsonfile, find thetemplate_typefield, and set its value to0This means that the system will default your template to be adaptive, so all devices will load the same template file.

The advantage of this model lies in the low maintenance cost, as content only needs to be published once, and the system will automatically adjust the display according to CSS. For most small and medium-sized enterprises and self-media, it is an efficient and practical choice.

2. Utilize code adaptation mode to finely control the mobile experience

If your website has higher customization needs for mobile, or there are significant differences in content display logic and interaction between PC and mobile, responsive design may not fully meet the needs.At this point, the Code Adaptive mode of AnQi CMS is very useful.

The core of code adaptation mode lies in the ability of Anqi CMS to intelligently judge the type of user's access device and then provide for PC and mobile terminalsdifferent HTML template filesBut they share the same backend data. For example, the PC end may display a richer information stream, while the mobile end focuses on core functions and concise navigation.

How to configure:

To enable code adaptation mode, first you need to create a subdirectory named in your template directory.mobileFor example, if your main template is in./template/defaultThen the mobile template is placed in./template/default/mobile.

Continue, you need toconfig.jsonin the file, settemplate_typeis set to1.

When the user visits your website:

  • If the system detects it is a PC device, it will load the main template folder (for example/template/default) the corresponding file.
  • If the system detects a mobile device, it will automatically switch to/template/default/mobilethe corresponding template file in the directory. For example, the homepage for the PC is/template/default/index/index.htmland the mobile will automatically search for/template/default/mobile/index/index.html.

This means you can design a layout and UI specifically for mobile devices, and even decide in the template which content is displayed on mobile devices and which is not, thereby providing optimized mobile performance and user experience.

Build a PC + mobile independent site model to achieve a completely isolated display

For those who need to treat PC and mobile as two almost completely independent but shared content sources, Anqi CMS provides a PC+mobile independent site mode. In this mode, your website will have two different access domains (such aswww.yourdomain.comused for PC,m.yourdomain.comFor mobile, and each loads an independent template.

How to configure:

  1. Template preparation:Similar to code adaptation mode, you need to create one in your main template directory.mobileSubdirectory, and design independent template files for mobile devices.
  2. System Settings:Log in to the AnQi CMS backend, go to 'Global Function Settings', find the 'Mobile End Address' field. Here, you need to fill in your mobile domain name, for examplehttps://m.yourdomain.com. The system will automatically determine which template to load based on the domain name visited.
  3. Configuration file:In your main templateconfig.jsonIn the file, willtemplate_typeis set to2.
  4. Domain name resolution and server configuration:This usually requires you to point the mobile domain to your server IP address at your domain registrar. If your server uses Nginx or Apache and other reverse proxy, you also need to configure the corresponding proxy rules to ensurem.yourdomain.comCan correctly point to the service port of AnQi CMS and AnQi CMS can recognize this domain.

In this mode, although the content on the PC and mobile ends originates from the same content library of AnQi CMS, they can be completely independent in terms of URL, template, and even front-end resources (CSS/JS), providing the greatest flexibility and control.

Content management consistency: The core advantage of AnQi CMS

No matter which display mode you ultimately choose, one of the core strengths of Anqi CMS lies in its consistent content management.You only need to publish content once in the background, such as an article or a product, Anqi CMS will use the same underlying data model and content data, regardless of rendering through PC template, mobile template, or adaptive style, they all point to the same content source.

This means you don't need to maintain multiple contents for different terminals, which greatly reduces operating costs and the complexity of content synchronization. You can utilizearchiveDetail/archiveListThe tags call the required content fields in any template, the system will automatically handle the data, and you only need to pay attention to the front-end presentation.

Summary

AnQi CMS enables you to have powerful multi-terminal content display capabilities through these three flexible configuration modes.Whether it is pursuing a simple adaptive design, or the need to provide a unique experience for mobile users through code adaptation, or the need for a completely independent PC and mobile site, AnQi CMS can provide perfect support.According to the scale of your website, the characteristics of your content, and your refined requirements for user experience, choosing the most suitable model will help you better reach user groups on different devices and enhance the overall competitiveness of your website.


Frequently Asked Questions (FAQ)

Q1: What are the main differences between code adaptation mode and PC + mobile independent site mode?A1: Code adaptation mode (template_type: 1) and PC + mobile independent site mode (template_type: 2Allow you to provide different template files for PC and mobile devices, the key difference lies inDomain. Code adaptation mode is usuallyon the same domainSwitch the template by judging the device type on the server; while the PC + mobile independent site mode usestwo different domain names(such aswww.domain.comandm.domain.com),even if the content source is the same, but when the user accesses it, it will load the corresponding PC or mobile template according to the visited domain.

Q2: Can I set different configurations for the content model (fields) on the PC and mobile端?A2: The content model of AnQi CMS is unified, which means the data fields you define for articles, products, etc. are shared between the PC and mobile ends.For example, the 'title', 'content', and other fields of an article are only maintained in one copy in the background.Templates on different terminals can selectively display, hide, or show in different styles with these fields, but cannot define a field on the PC side that does not exist on the mobile side.

Q3: How to manage CSS, JavaScript, and other static resources for mobile end when choosing code adaptation or independent site mode?A3: In these modes, since you have already createdmobilea subdirectory to store mobile template files, you can alsomobilecreate the corresponding one inside the directorycss/jsorimagesFolder, place the static resources exclusive to the mobile end here. Then, in the mobile template, pass through.{% system with name="TemplateUrl" %}/mobile/css/style.cssIn a similar way, refer to these resources, ensuring that PC and mobile resources do not interfere with each other, achieving better loading performance and management.

Related articles

How to implement independent templates for different pages (such as articles, products, single pages) in Anqi CMS?

In website operation, we often need to adopt completely different layouts and design styles for different types of content, such as a deep article, a product display page, or an 'About Us' single page.This differentiated display not only enhances user experience, but also helps content better convey information and achieve marketing goals.AnQiCMS (AnQi CMS) provides a very flexible and powerful solution in this regard, allowing us to easily implement independent templates for different pages.

2025-11-08

How to customize the display layout of content on the frontend page in Anqi CMS?

AnQiCMS (AnQiCMS) is an efficient and flexible content management system that provides us with great freedom with its powerful template functions and content model, allowing us to finely control the layout of content on the front-end page according to the actual needs of the website.To achieve this goal, we need to deeply understand the template engine, content model, and built-in tags of Anqicms.

2025-11-08

How to efficiently organize and reference common page header, footer, and other code snippets in the front-end page template?

Manage front-end page code in AnQi CMS, especially the header, footer, and other code snippets that need to be repeated on multiple pages, which is a key to improving development efficiency and website maintainability.AnQi CMS provides a powerful and flexible template engine, allowing us to organize and reference these common codes in an elegant way. ### The Importance of Template Reusability Imagine if your website has dozens, even hundreds of pages, each of which independently contains the complete header, navigation, and footer code. When the website's logo needs to be replaced, or the footer copyright information needs to be updated

2025-11-08

What are the common variable naming and tag syntax rules (such as `{{variable}}` and `{% tag %}`) when making AnQiCMS templates?

To create templates in AnQiCMS and master its variable naming and tag syntax rules is the core.The system is developed based on the Go language, the template engine borrows the syntax style of Django and Blade, making content output and logical control very intuitive.When you are doing template development, you will mainly encounter two basic syntax structures, each of which has different responsibilities.### Core grammar structure: variable output and logical control First are double curly braces `{{ variable }}`, which have a very direct function

2025-11-08

How to dynamically retrieve and display an article list through template tags in Anqi CMS?

Dynamic display of website content is one of the core elements of modern website operations, which not only enhances user experience and allows visitors to easily find the information they are interested in, but also effectively assists in search engine optimization (SEO), making the website more favored by search engines.In Anqi CMS, through the powerful template tag function, we can very flexibly obtain and display various types of article lists.The AnQi CMS template system has adopted the syntax of the Django template engine, with a natural and smooth style, making it very quick for you who are familiar with frontend development.

2025-11-08

How to filter and display specific content lists based on categories, modules, or recommended attributes?

When using AnQi CMS to manage website content, we often need to display specific content (such as articles, products) in the form of a list in different areas of the website.This may mean that we need to display the latest headline articles on the homepage, only show products from a specific series on the product category page, or recommend some popular content in the sidebar.AnQi CMS provides flexible tags, allowing us to accurately filter and display the content list we need based on various conditions such as categories, content models, or recommendation attributes.

2025-11-08

How to implement the complete information display of the content detail page in AnQi CMS (including custom fields)?

In website operation, the content detail page is the core entry for visitors to understand products or services, and the completeness of information display and user experience is crucial.AnQiCMS (AnQiCMS) takes full consideration of the flexibility and customization of content display in its design, even for various custom fields you define, they can also be presented elegantly on the content detail page.Next, we will explore how to fully display all the information of the content detail page in Anqi CMS, from the establishment of the content model to the call of the template, including those unique custom fields.### Build Content Skeleton

2025-11-08

How to optimize image display in content lists and detail pages (thumbnails, multiple images, lazy loading)?

In the digital age where content is king, images on websites are not only visual decorations but also key elements in attracting users, conveying information, and enhancing brand image.However, unoptimized images may also become the culprit that slows down website loading speed, affects user experience, and even damages SEO performance.Fortunately, AnQiCMS (AnQiCMS) provides us with a comprehensive and powerful image optimization tool, allowing the website to maintain visual appeal while achieving high-performance loading.

2025-11-08