To provide special optimization for the mobile experience of the website in AnQiCMS (AnQiCMS) is a very practical requirement.Thanks to the flexible template mechanism of AnQiCMS, we can easily achieve this goal.When it comes to providing a set of independent template files for mobile devices, the storage location and configuration method of these templates are crucial.

In simple terms, if you want AnQiCMS to recognize and apply templates specifically designed for mobile devices, you need to store these template files in the current directory being used.Template theme directory undermobileSubdirectory.

AnQiCMS provides three main modes in template design to meet different website needs:

  1. Responsive ModeThis mode uses the same template file for both PC and mobile endpoints.With technologies such as CSS media queries, websites can automatically adjust layouts and styles based on the screen size of the user's device to provide an **enhanced** browsing experience.mobiledirectory.
  2. Code Adaptation ModeIn this mode, the system detects the user's device type through backend code and loads different templates based on the detection result.If you choose this mode, the PC template and the mobile template will be two separate files.mobilesubdirectory.
  3. PC+Mobile Independent Sites Mode (PC+Mobile Independent Sites)This model is more thorough; both PC and mobile ends not only use independent templates but can also bind independent domains. For example, access from the PC endwww.yourdomain.com, access from the mobile endm.yourdomain.comIn this case, the mobile template also needs to be stored in the main template directory under,mobilethe subdirectory.

Whether it is the "code adaptation" or the "PC + mobile independent site" mode,mobileAll catalogs play a crucial role. ThismobileThe directory is not simply an empty folder; the internal directory structure and template file naming conventions should be consistent with your PC template directory. For example, if your PC home page template isindex.htmlThe article detail page template isarchive/detail.htmlthenmobileunder the directory, you should also haveindex.htmlandarchive/detail.html(or other mobile-specific templates that comply with the naming conventions, such as)archive/detail-mobile.htmlThey will separately carry the design of the mobile homepage and article detail page. So when the system detects a mobile device visit, it will automatically frommobileFind and load the corresponding template file in the catalog.

To enable this independent mobile template mode on the AnQiCMS backend, you need to select the corresponding 'template type' (such as 'code adaptation' or 'computer + mobile') under 'System Settings' or 'Global Settings'.If PC+mobile independent site mode is selected, you need to further configure the 'mobile site address' to point to the domain name of your mobile site.

This structured management approach ensures that mobile users receive a specially optimized browsing experience, while also efficiently organizing and maintaining the website template files, enabling precise control over different access devices.


Common Questions (FAQ)

  1. Do you need to create and place the mobile template in the "Adaptive" mode?mobileDo you need to create a directory and place the mobile template?Generally not required.The adaptive mode is designed to adapt to all devices with a single template, and the template itself adjusts the layout through responsive design (such as CSS media queries).mobileDirectory searching for template files. Only consider using 'code adaptation' or 'PC+mobile independent site' mode and creatingmobiledirectory.

  2. mobileIs the naming of template files within the catalog required to be identical to the PC end?Yes, in order for AnQiCMS to correctly match and load the mobile template,mobileThe template file naming within the catalog should be consistent with the corresponding files on the PC end. For example, if the template for the article list page on the PC end isarchive/list.htmlThen, the mobile article list page template should also be namedmobile/archive/list.html. The system will automatically look for the corresponding matching file in the directory based on the URL and device typemobile.

  3. How to ensure that AnQiCMS correctly associates the PC and mobile templates?This is achieved through two aspects: first, in the background "Global Settings", you need to set the "Template Type" to "Code Adaptation" or "Computer + Mobile" mode; second, make sure that all your mobile template files are correctly placed in the main template directory.mobileIn the subdirectory, and its naming is consistent with the template file on the PC end. When AnQiCMS receives an access request, it will judge the device type according to the user agent (User-Agent) and then decide whether to use the root template directory ormobileLoad the corresponding page template for the subdirectory.