How to configure website adaptive display on different devices (PC, mobile)?

Calendar 78

In the era of the prevalent mobile Internet, whether a website can provide a smooth and beautiful browsing experience on different devices (whether it is a large screen PC or a small mobile phone) has become a key factor in measuring the success of a website.AnQiCMS knows this pain point and provides you with flexible and powerful adaptive display configuration capabilities, allowing your website to easily navigate the multi-screen world.

AnQiCMS divides the adaptive display methods of websites into three main modes, you can choose the most suitable solution according to your business needs and technical preferences.

One, Adaptive Mode: Integrated Responsive Design

This pattern is the mainstream responsive design method at present, it makes your website like a tailor-made clothing, no matter what size of the device the visitor uses, the website can automatically adapt to the screen by intelligently adjusting the layout, image size, and font, etc., and provide a visual effect. **

How to configure:This mode is very simple, mainly designed on the front-end template level. Find the file in your AnQiCMS template folderconfig.jsonfile, and settemplate_typefield to0.This means you will adopt a unified HTML template and mainly rely on CSS3 Media Queries technology to respond to different screen sizes.AnQiCMS renders the template directly in the background, providing the content to the browser, which adapts it based on the device characteristics.

Advantage:

  • Low maintenance cost:Only one set of template code needs to be maintained, and content updates are synchronized.
  • SEO friendly:All devices share the same URL, avoiding duplicate content issues, which is beneficial for search engine rankings.
  • Consistent user experience:The brand image and features are highly consistent across all devices.

Second, code adaptation mode: intelligent switching on the server side

The code adaptation mode lies between pure adaptation and completely independent sites.It is just like preparing different styles of clothing for different occasions, although the styles are different (PC template and mobile template), but they are all stored in the same closet (under the shared main domain URL).When a user visits your website, AnQiCMS will intelligently select and render the dedicated template for PC or mobile end according to the 'identity' of the user's device (User-Agent, that is, the type of access device).

How to configure:First, you need to modify the template you are currently usingconfig.jsonfile, totemplate_typefield to1.

Next, prepare a dedicated template for mobile devices. You need to create a subdirectory namedmobilein the current main template directory. For example, if your main template isdefaultthen the mobile template should be placed in/template/default/mobile/. In thismobiledirectory, you can create corresponding mobile version template files based on the structure of the PC template, such asindex.html(Mobile Home Page),article/detail.html(Mobile Article Detail Page) and so on.

AnQiCMS will automatically load and use the corresponding template when it detects a mobile device visit, while PC device visits will use the template under the main directory.mobiletemplate from the directory, while PC device access will use the template under the main directory.

Advantage:

  • Fine control:You can design completely different layouts and interaction logic for PC and mobile, and even hide or display certain features.
  • SEO friendly:Even though different templates are used, the same URL is still shared, avoiding SEO complexity caused by different URLs.

Three, PC+mobile independent site mode: independent operation with dual domain

This model is the highest level of customization solution, it is more like having two independent stores, one dedicated to PC users and the other to mobile users, each with its own independent domain and operational strategy. For example, your PC site might bewww.example.comWhile the mobile station ism.example.com.

How to configure:

  1. Template configuration:Similarly, in the template you are usingconfig.jsonIn the file, willtemplate_typefield to2. And you need to create it in the main template directory.mobileSubdirectory, and put it into the exclusive template of the mobile site.
  2. Back-end settings:Log in to the AnQiCMS backend and go to the "Global Function Settings".You will see an option named 'Mobile End Address'.m.example.com.
  3. Server configuration:This step is crucial. You need to ensure that the mobile site's domain (such asm.example.com) Has been parsed to your server IP, and the Nginx or Apache web server and other web servers have configured the corresponding reverse proxy, which will be able tom.example.comThe request is forwarded to the AnQiCMS running port.If you use Baota panel or 1Panel and similar tools for deployment, you can refer to the configuration method of multi-site reverse proxy in their Docker installation tutorial.The "Multi-site Management" feature of AnQiCMS also supports managing multiple domain names under a single system, which is convenient for centralized management.
  4. SEO optimization (very critical):To avoid search engines mistakenly identifying it as duplicate content and ensure SEO effects, it is essential to configure the template correctly on both PC and mobile ends.rel="canonical"andhreflang.
    • In the PC station template, userel="alternate"And point to the mobile station URL usingrel="canonical"And point to the PC station URL.

Related articles

What are the basic syntax rules of the AnQiCMS template engine used to display content?

AnQiCMS provides a user-friendly and powerful template engine, its design philosophy is to make the display of website content both flexible and easy to use.If you are familiar with template syntax like Django or Blade, then AnQiCMS's template engine will be very familiar to you.It is committed to presenting complex backend data in a clear and readable manner on the website front end, allowing content managers to focus on content creation and optimization rather than getting lost in the details of the code.

2025-11-08

How can you use the scheduled publishing feature to precisely control the display time of content on the website?

In the daily work of content operation, the timing of content release is often closely related to the communication effect, user reach, and overall activity of the website.It is particularly important to control the display time of content on the website accurately, whether it is to cater to the peak of user activity, cooperate with marketing activities, or simply to maintain the regularity of website updates.Anqi CMS knows this point, therefore it has specially designed an efficient and convenient scheduling publishing function, making content going online more strategic and automated.### Precisely control the timing of content going live Want to take advantage of the scheduling publishing feature of Anqi CMS, the process is actually very intuitive

2025-11-08

How to control the display permission of specific content based on user groups and VIP levels?

In website operation, providing differentiated content experience for different user groups is an important strategy to enhance user stickiness and achieve content monetization.The user group and VIP system of AnQiCMS (AnQiCMS) is the key function that helps us achieve this goal.By flexibly setting the display permissions of content, you can easily create paid content, exclusive member articles, or tiered reading services, making your website content more valuable.### Deeply understand the user group and VIP system of AnQi CMS AnQi CMS built-in user group management and VIP system

2025-11-08

How does AnQiCMS protect the copyright of displayed content through anti-crawling and watermark functions?

In the digital age, the value of original content is self-evident, but the problem of content theft and plagiarism is becoming increasingly prominent.For website owners and enterprises who work hard in creation, how to effectively protect their digital assets has become an important issue.AnQiCMS (AnQiCMS) fully understands this pain point, and from the very beginning of the system design, it has placed content copyright protection at the core position, especially through its built-in anti-crawling interference code and image watermark features, providing users with a comprehensive and efficient content protection strategy.### Content collection prevention: Protect the originality of text thoughts Imagine, the carefully written article you have written

2025-11-08

How does the new content model feature enhance the flexibility of content display?

In today's rapidly changing digital world, the content carried by websites is no longer just simple articles and product introductions.From an exciting online event, a detailed customer case, to a professional team introduction, and a complex service process, each type of content has its unique attributes and presentation methods.If your content management system (CMS) still only uses the universal templates of "article" or "product" to publish all information, it will undoubtedly bring many limitations to content creation and display.

2025-11-08

How to display the Tag tag list of articles or products in AnQiCMS?

In Anqi CMS, flexibly displaying the Tag tag list of articles or products is a key link to improving the organization of website content and user experience.By carefully designed tags, it can not only help visitors quickly find the content they are interested in, but also effectively optimize search engine crawling and improve the website's SEO performance.Today, let's delve into how to fully utilize the Tag feature in AnQiCMS to revitalize the content of your website.### Understanding AnQiCMS Tag Tags In the AnQiCMS management background

2025-11-08

Does the background template editing function support real-time preview of content display effects?

AnQi CMS is favored by many operators for its efficient and flexible features in the field of website content management.When we talk about the visual presentation and user experience of a website, the customization capabilities of the template are undoubtedly the core.Among them, the real-time preview of the background template editing function and the display effect of the content is a focus for many users. ### The template editing capability of AnQi CMS: powerful and flexible AnQi CMS provides users with powerful and flexible backend template editing functions.The system uses a template engine syntax similar to Django, which is understandable for users familiar with front-end development or template languages

2025-11-08

How can I customize a template for a specific category or page to control the display style?

When operating a website, we often encounter situations where different types of content, even articles in the same category or different "About Us" pages on the same website, hope to have a unique display style to better attract readers and convey information.AnQiCMS (AnQiCMS) is well aware of this need and therefore provides a very flexible template customization mechanism, allowing us to easily tailor the display style for specific categories or pages.The Anqi CMS template system is based on the Django template engine syntax in Go language, which means that as long as you have a basic understanding of front-end development

2025-11-08