First, in the Phpcms V9 management background set up the mobile phone portal
1.1, open the mobile website. Location: module "mobile phone Portal" Add mobile site, the specific settings can be referred to:
Fill in the site name and the relative location of the logo file, binding the two-level domain name m.cmsyou.com for the mobile website, the domain name begins with http://.
1.2, create column classification, location: module "mobile phone Portal" classification management, specific settings can be referred to:
Create a good classification and bind the corresponding columns.
In this way, the mobile site in the management background configuration is basically complete.
Second, domain name resolution, mobile domain binding
2.1, to the Domain name Management Center, the resolution two level domain name m.cmsyou.com to the PC website is located the IP, simultaneously in the host Control Panel, adds the binding m.cmsyou.com this domain name.
2.2, modify the configuration file caches/configs/route.php, in the ' Default ' =>array (' m ' + = ' content ', ' c ' = ' = ' index ', ' a ' = ' + ' init '), Add a row later, modified to:
Return Array (' default ' =>array (' m ' = ' content ', ' c ' = ' = ' index ', ' a ' = ' = ' init '), ' m.cmsyou.com ' = >array (' m ' = = ' wap ', ' c ' = ' = ' index ', ' a ' = ' = ' init ', ' Data ' =>array (' GET ' =>array (' SiteID ' =>1) '), );
2.3, in the management background refresh cache, and other domain name resolution after the effective, access to m.cmsyou.com try. Because the mobile website needs to use the index.php as the guide, can set the index index order in the host control panel inside, the index.php adjustment order is higher than index.html.
If the host control Panel does not have this setting, then you need a cell phone template (index.html or header.html) inside to add a JS:
<script> try {if (self.location = = "http://wap.domain.com/") { top.location.href = "/http/ Wap.domain.com/index.php "; } } catch (e) {} </script>
Third, modify the custom mobile site template, and start making adaptive website!
Domain name resolution after the effective, through the m.cmsyou.com can access to the mobile site, then how to control the mobile phone site display style, it is natural to modify the custom phone template.
Specific location:/phpcms/templates/default/wap/or custom template directory.
Because the mobile website classification can only bind the actual article, the product and so on the model column, cannot bind the order page, then we can achieve the column content display diversification through if. How to use the specific method, you can focus on Cmsyou public number: Cmsyou, through questioning or interaction.
Transferred from: http://blog.csdn.net/veloi/article/details/51451328
PHPCMS V9 Mobile Portal Setup Tutorial: How to use PC V9 to do mobile website