How to specify an independent mobile template for multi-site in AnQiCMS template creation?

Calendar 👁️ 72

Hello! As a senior CMS website operator, I fully understand the importance of providing an optimized experience for different sites in the increasingly growing mobile traffic trend.The advantages of AnQi CMS in multi-site management and template flexibility make it very convenient to specify a dedicated mobile template for each independent site.Below, I will elaborate on how to achieve this goal in AnQi CMS.

Specify the mobile template for an independent site in AnQiCMS multi-site management

In the Anqi CMS ecosystem, specifying an independent mobile template for multiple sites is a powerful feature that allows operators to provide highly customized mobile user experiences for different brands or content branches.This approach goes beyond single responsive design, giving the site the ability to display unique layouts, content, and interactions on mobile devices.

Understand the template adaptation mode of AnQiCMS

The Anqi CMS provides three main template adaptation modes: adaptive, code adaptation, and PC + mobile independent site.To implement an independent mobile template, we need to choose one of the latter two modes.

Adaptive mode uses a set of templates to automatically adjust the layout to fit various screen sizes, without the need for a separate mobile template.However, when a site needs more refined mobile control or a completely different content presentation, code adaptation or a PC + mobile independent site mode becomes an ideal choice.

The code adaptation mode detects the User-Agent information of the device accessed by the user, automatically loading the PC or mobile template.The PC+mobile independent site mode takes this a step further, allowing a separate domain to be bound for the mobile end (such as m.example.com), thus distinguishing PC and mobile traffic at the domain level, providing users with a more exclusive access path.

Conventions for the directory structure of mobile templates

AnQi CMS has clear conventions for the organization structure of mobile template. Whether you choose code adaptation or PC+mobile independent site mode, all template files specially designed for mobile devices must be stored in the current template directory.mobile/In the subdirectory.

For example, if the template you are using is namedmy_custom_templateit is located/template/my_custom_template/then the corresponding mobile end file of the template should be placed at/template/my_custom_template/mobile/. Thismobile/The template file naming and structure within the directory should be consistent with the PC template directory (i.e.my_custom_templatethe directory itself). This means that if the PC hasindex.htmlas the homepage, then inmobile/It should also have a directoryindex.htmlto carry the content of the mobile homepage.

Through this standardized directory structure, AnQi CMS can efficiently identify and call the correct template files, ensuring that the expected content is presented on different devices.

Configure the template package'sconfig.json

In the root directory of the template package, there is a file namedconfig.jsonwhich defines the various properties of the template. To enable the independent mobile template feature, thetemplate_typefield in this file is crucial.

You need totemplate_typeThe value is set to1(Represents code adaptation) or2(Represents PC + mobile). For example, if your template is intended to support PC and independent mobile site, and the mobile site has an independent domain,config.jsonThe relevant part should be as follows:

{
    "name": "我的PC移动分离模板",
    "package": "my_separated_template",
    "version": "1.0",
    "description": "一套支持PC和独立手机端域名的AnQiCMS模板",
    "template_type": 2, 
    "status": 0
}

This configuration clearly indicates to the Anqie CMS system that this template package contains independent mobile views, and the system will load the corresponding template set according to the user's device type and site configuration.

Specify the mobile template for multiple sites in the AnQiCMS background

Complete the organization of the template filesconfig.jsonAfter the configuration, the next step is to make specific settings for each independent site in the Anqi CMS backend management interface.

When you add or edit a site in the "Multi-site Management" feature, you first need to select a template that has been configured to support code adaptation from the "Select Template" dropdown menu (template_type: 1) or PC + mobile independent site (template_type: 2) template.

If you choose the PC + mobile independent site mode, then in the site's 'Global Function Settings', you will see a configuration item named 'Mobile End Address'. Here, be sure to fill in the exclusive mobile domain name of the site (such asm.yoursite.comEnsure that this domain has been correctly resolved to your server IP by your DNS service provider, and that the corresponding reverse proxy rules have been configured on your web server (such as Nginx or Apache) to direct the mobile domain to the AnQiCMS service port.

Through these detailed backend configurations, each independent site managed in Anqi CMS can have its own PC and mobile template, and can configure independent mobile domain names as needed, thus achieving content presentation and management efficiency on different devices.

Conclusion

AnQi CMS with its high flexibility and powerful multi-site management capabilities provides operators with tools to deal with complex content management and diverse user needs. Through careful planning of the template structure, accurate configurationconfig.jsonAnd in the background management, specify the correct template type and mobile end address for each site, you will be able to create a first-class mobile user experience for different sites, effectively enhance brand influence and market competitiveness.


Frequently Asked Questions

Ask: What is the difference between the 'Adaptive' template mode and the 'Code Adaptation' mode of AnQi CMS? How should I choose?

Answer: Adaptive mode refers to a set of template codes that can automatically adjust layout and style based on the screen size and characteristics of the accessing device, usually achieved through CSS media queries and other technologies, without the need for a separate mobile template file.While code adaptation mode means you have created two completely independent template files for the PC and mobile ends, Anqi CMS will judge and load the corresponding PC or mobile template according to the User-Agent information of the user's device.Choose which mode depends on your needs. If the content and structure of the site can be kept highly consistent on PC and mobile, it's simpler to use the adaptive mode;If the mobile end needs to present very different content, features, or interaction logic from the PC end, then the code adaptation mode can provide greater freedom and optimization space.

Ask: Can I use different mobile templates for different sites in multi-site management, rather than just copying a set of templates?

Of course you can. Anqi CMS offers very flexible multi-site management. You can design and upload a completely independent template package for each independent site, and in each template package,config.jsonConfigure itstemplate_typeThis means that site A can use a set of templates named "TemplateA" (including its PC and mobile end), while site B

Related articles

What is the default directory structure of template files in AnQiCMS multi-site mode?

AnQiCMS is a system designed to provide an efficient content management solution for small and medium-sized enterprises and content operation teams. Its template file organization structure under the multi-site mode is carefully designed to ensure flexibility, maintainability, and independence.In a multi-site environment, AnQiCMS allows administrators to manage multiple sets of templates in a unified template library and to select appropriate template sets for each site, thereby decoupling content from presentation.

2025-11-06

How to troubleshoot and solve the port occupation problem during AnQiCMS installation?

Hello!As an experienced CMS website operator for a cybersecurity company, I fully understand the trouble of encountering port occupation problems during the system installation process.This is indeed a common situation encountered by beginners, but as long as you master the correct method, troubleshooting and solving it is not complicated.Below, I will elaborate on how to troubleshoot and resolve the issue of port occupation during the AnQiCMS installation process.

2025-11-06

How to configure multiple site Nginx proxy in the command line environment for AnQiCMS?

Hello!As an experienced AnQi CMS operation person, I am very happy to be able to explain in detail how to efficiently configure Nginx reverse proxy in a command-line environment to support the multi-site deployment of AnQiCMS.AnQiCMS's powerful multi-site management function, combined with Nginx's flexible proxy mechanism, can help you easily manage multiple independently running websites on the same server, greatly enhancing operational efficiency.

2025-11-06

How to merge multiple AnQiCMS 2.x sites into one 3.x management?

As an experienced AnQiCMS website operation personnel, I fully understand your desire to unify multiple existing AnQiCMS 2.x sites into the 3.x version for management.The AnQiCMS 3.x version has made significant optimizations in multi-site management, aiming to simplify operations and improve efficiency.The article will detail this merging process, helping you complete the upgrade smoothly. ### Unified Management: Merging Multiple AnQiCMS 2.x Sites into 3.x Management With the release of AnQiCMS 3.x version, the multi-site management model has ushered in innovation.

2025-11-06

How does the AnQiCMS backend custom URL affect multi-site SEO?

As a website owner who deeply understands the operation of AnQiCMS, I know that a flexible and SEO-friendly URL structure is important for a website, especially for multi-site operations.AnQiCMS offers powerful backend URL customization capabilities, which not only greatly enhances the accessibility of content but also lays a solid foundation for the implementation of SEO strategies across multiple sites.

2025-11-06

How to set up a separate backend domain for each site in AnQiCMS multi-site?

As an experienced security CMS website operator, I am well aware of the importance of efficiently and safely managing each site in a multi-site environment.Each site sets up an independent backend domain, not only an effective means to enhance security, but also a crucial step for brand separation and specialized operation.Next, I will elaborate on how to configure independent backend domains for each of your sites under the AnQiCMS multi-site architecture.

2025-11-06

What is the recommended panel version for installing AnQiCMS Docker version on Baota panel?

As an expert in content creation and website operation of AnQiCMS, I am delighted to elaborate on the relevant matters of installing AnQiCMS Docker version on the Baota panel and clearly recommend the panel version.We are always committed to providing users with efficient, stable, and easy-to-manage content solutions, and the combination of Baota Panel and Docker is an efficient way to achieve this goal.

2025-11-06

How to install Docker service and related dependencies on Baota panel?

As an operator who deeply understands the way of security CMS and knows that the core of website operation lies in providing clear and valuable content to users, I understand that you hope to get a detailed and easy-to-follow guide.Deploying AnQi CMS is an important starting point, and using Baota panel combined with Docker technology, no doubt can make this process more efficient and secure.Below, I will elaborate on how to install Docker service and related dependencies on the Baota panel, so that you can deploy and run Anqi CMS smoothly.--- ### Deploy Docker service and related dependencies on Baota panel

2025-11-06