Optimizing the mobile user experience is crucial for modern website operations, and designing content templates specifically for mobile devices is an efficient way to achieve this goal.AnQi CMS provides a flexible mechanism that allows users to provide the most appropriate browsing experience according to their needs.

Understand the Anqi CMS mobile template mode

AnQi CMS to meet the diverse needs of mobile terminal adaptation, built three main website modes, which determine how content is displayed to mobile users:

  • Type of responsive templateThis is the most common pattern, meaning that you only need a single template, and the website will automatically adjust the layout and style according to the screen size of the user's device.This model has the advantage of lower development and maintenance costs, unified content management, but the disadvantage is that the design flexibility of mobile and PC ends is limited, and may not meet the needs of highly customized mobile end experience.
  • Type of code adaptationIn this mode, the system automatically determines the user's access device (PC or mobile) and provides different template files.This means you can design two independent templates for mobile and PC, but they usually share a set of background data and logic.This mode is a very practical choice, between the adaptability and the independent site of PC + mobile phone terminal in terms of design freedom.
  • PC + mobile phone independent site modeThis is the most thorough independent mode, you can set up completely different domain names for PC and mobile terminals, and have independent templates and content display strategies for each.This mode provides the greatest flexibility, even allowing different content focal points on mobile and PC platforms, but the management and maintenance costs are relatively high.

Choose the appropriate mobile strategy

Faced with these patterns, the choice of which one to choose depends on your specific needs and resource investment.

If your website content structure is relatively simple, there are no particularly complex requirements for mobile design, and the budget is limited, thenAdaptive templateIt is probably the most cost-effective and efficient choice. It can ensure that the website is basically available on various devices.

But if your goal is to provide an optimal experience for mobile users, or if you want the mobile end to have a completely different layout, interaction, and even some content from the PC end, thenCode adaptation templateorPC+Mobile Standalone SiteIt has more advantages. Especially for those who want to highlight touch interaction on the mobile end, simplify the information hierarchy, or carry out specific marketing activities on websites, these two modes can provide greater creative space.

For the goal of "Designing and displaying content templates specifically for mobile devices,"Code adaptation template typeIt is a direct and commonly used implementation method. It allows you to maintain unified content management while providing a customized mobile interface.PC+Mobile Standalone SiteProvided a higher level of separation, suitable for websites with completely independent mobile strategies.

How to design templates separately for mobile endpoints.

After you choose the code adaptation or PC+mobile independent site mode, Anqie CMS provides an intuitive template separation mechanism. The core is to create a special directory:mobile.

  1. CreatemobileTable of contentsIn the folder of the template theme you are currently using (for example/template/ๆ‚จ็š„ไธป้ข˜ๅ/), create a folder namedmobile.
  2. Copy and customize the template: Copy the corresponding template file from the PC end, following its original directory structure, to the newly createdmobiledirectory. For example, if your PC end home page template isindex/index.htmlThen the corresponding template for the mobile end is placed inmobile/index/index.htmlSimilarly, the document detail page template ({ๆจกๅž‹table}/detail.html) List page template ({ๆจกๅž‹table}/list.html) Single page template (page/detail.html) and others can all be copied and customized tomobileIn the catalog.
  3. Follow the same structure:mobileThe template files and directory structure within the directory should be consistent with the template structure on the PC side. This means that if there ispartial/directory storing common code snippets, thenmobile/It can also be therepartial/It is used to store public segments specially customized for mobile devices.

For example:

Assuming the structure of your PC template is as follows:

/template/your_theme/
โ”œโ”€โ”€ config.json
โ”œโ”€โ”€ index/
โ”‚   โ””โ”€โ”€ index.html
โ”œโ”€โ”€ article/
โ”‚   โ””โ”€โ”€ list.html
โ”‚   โ””โ”€โ”€ detail.html
โ””โ”€โ”€ partial/
    โ””โ”€โ”€ header.html
    โ””โ”€โ”€ footer.html

Then, when designing a template separately for mobile devices, you will create:

/template/your_theme/
โ”œโ”€โ”€ config.json
โ”œโ”€โ”€ index/
โ”‚   โ””โ”€โ”€ index.html
โ”œโ”€โ”€ article/
โ”‚   โ””โ”€โ”€ list.html
โ”‚   โ””โ”€โ”€ detail.html
โ”œโ”€โ”€ partial/
โ”‚   โ””โ”€โ”€ header.html
โ”‚   โ””โ”€โ”€ footer.html
โ””โ”€โ”€ mobile/ # ๆ–ฐๅขž็š„็งปๅŠจ็ซฏๆจกๆฟ็›ฎๅฝ•
    โ”œโ”€โ”€ index/
    โ”‚   โ””โ”€โ”€ index.html # ็งปๅŠจ็ซฏ้ฆ–้กตๆจกๆฟ
    โ”œโ”€โ”€ article/
    โ”‚   โ””โ”€โ”€ list.html # ็งปๅŠจ็ซฏๆ–‡็ซ ๅˆ—่กจๆจกๆฟ
    โ”‚   โ””โ”€โ”€ detail.html # ็งปๅŠจ็ซฏๆ–‡็ซ ่ฏฆๆƒ…ๆจกๆฟ
    โ””โ”€โ”€ partial/
        โ””โ”€โ”€ header.html # ็งปๅŠจ็ซฏๅ…ฌๅ…ฑๅคด้ƒจ
        โ””โ”€โ”€ footer.html # ็งปๅŠจ็ซฏๅ…ฌๅ…ฑๅบ•้ƒจ

This, when the user accesses through the mobile phone, Anqi CMS will automatically identify and load it firstmobileThe corresponding template file under the directory.

Design and optimization suggestions for template content

Designing a mobile template individually is not just about adjusting the layout, but also an opportunity to optimize the user experience.

  1. Touch-friendly designThe phone screen is primarily used for touch operations. Ensure that clickable elements such as buttons and links have enough large touch areas and maintain appropriate spacing to avoid accidental taps by users.Navigation menus usually take the form of hamburger menus (Hamburger Menu) and hide secondary information, displaying only the most critical navigation entries.
  2. Simplified information hierarchyMobile users often have limited patience and need to quickly obtain information.Prioritize displaying the most important content, and fold or place secondary information at a deeper level.Use headings, subheadings, short paragraphs, and lists to make the content easy to scan and read.
  3. Image and multimedia optimization: The mobile network environment may be unstable. Ensure that all images are properly compressed and consider using more efficient image formats such as WebP. Anqi CMS providesContent settingsThe images are automatically compressed, combined with lazy loading (such as inarchiveDetailUsed in tagslazy="data-src"), which can significantly improve loading speed.
  4. Font readabilityChoose a font that is clear and easy to read on small screens, and set the appropriate font size and line height to avoid small or dense text.
  5. Reduce unnecessary interactions: Complex forms, hover effects, and other mobile experience issues should be simplified or replaced with more touch-friendly operations.
  6. Utilize the AnQiCMS tag featureInmobileIn the template, you can continue to use various tags provided by Anqi CMS, such asarchiveList/categoryDetail/systemFlexible access and display of content. For example, you may want the article list on the mobile end to only display the title and thumbnail, while the PC end displays more descriptive information.

Back-end configuration and details

After the creation and optimization of the mobile template, it is also necessary to make corresponding configurations in the Anqi CMS backend to ensure that the system can correctly identify and enable these templates:

  • Template Type SettingIn your template theme directory:config.jsonfile, find thetemplate_typefield.
    • If you want to use code adaptation mode, please settemplate_typeis set to1.
    • If you want to use PC + mobile independent site mode, please settemplate_typeis set to2.
  • Mobile end address (only PC and mobile independent site mode): If you choose the PC and mobile independent site mode, you need to fill in the background'sGlobal feature settingsin, please fill in yourMobile end addressMake sure the domain name is resolved and points to your server.

By following these steps, your security CMS website can present specially optimized mobile content templates to mobile users, thereby significantly improving their access experience and helping them perform better in mobile search rankings.


Frequently Asked Questions (FAQ)

1. If I created a directory for mobile but it lacks a template file for a certain page, how will the system handle it?mobileDirectory, but it lacks a template file for a certain page, how will the system handle it?

The AnQi CMS is designed to be smart. If the system detects that the user is accessing from a mobile device, andmobileThe corresponding template file cannot be found in the directory, it will automatically fallback to the default template file on the PC for rendering.This means you do not need to customize mobile templates for all pages separately, you can only deeply optimize key pages, and other pages can follow the PC template, thereby effectively reducing maintenance costs.

2. Can I publish completely different content for mobile and PC ends in the independent site mode for PC + mobile?

The PC+mobile independent site mode offers great flexibility.Although they share the same Anqi CMS backend system and content model definition, you can control the way content is displayed at the template level.For example, you can design a PC template to display all articles, while the mobile template only displays specific 'mobile exclusive' article categories.Additionally, throughContent modelCustom fields, you can even add custom fields to each piece of content.