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