zoukankan      html  css  js  c++  java
  • 织梦后台如何设置手机站

    1. 模板首先有css,htm文档,Js文件等

      织梦手机模板怎么设置
    2.  

      做好这些后,命名非常的重要,比如首页模板是index.htm,那么手机站的首页模板名字必须为index_m.htm,其他的也是必须在后面加上_m

      织梦手机模板怎么设置
    3.  

      代码部分,栏目的链接代码,我们电脑站一般是用[field:typeurl/],手机站则是list.php?tid=[field:id/]

      织梦手机模板怎么设置
    4.  

      文章链接的代码,电脑端一般是[field:arcurl/],手机端是view.php?aid=[field:id/]

      织梦手机模板怎么设置
    5.  

      注意手机端模板调用的时候要调用带m的

      织梦手机模板怎么设置
    6.  

      可在电脑端模板加如下代码,实现手机打开网站自动跳转到m文件夹,实现自动跳转到手机端

      <script type="text/javascript">

      if(/AppleWebKit.*mobile/i.test(navigator.userAgent) || (/MIDP|SymbianOS|NOKIA|SAMSUNG|LG|NEC|TCL|Alcatel|BIRD|DBTEL|Dopod|PHILIPS|HAIER|LENOVO|MOT-|Nokia|SonyEricsson|SIE-|Amoi|ZTE/.test(navigator.userAgent))){

          if(window.location.href.indexOf("?mobile")<0){

              try{

                  if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){

                      window.location.href="http://www.你的链接.com/m";

                  }else if(/iPad/i.test(navigator.userAgent)){

                      window.location.href="http://www.你的链接.com/m";

                  }else{

                      window.location.href="http://www.你的链接.com/m"

                  }

              }catch(e){}

          }

      }

      </script>

      织梦手机模板怎么设置
    7.  

      访问m文件夹的时候会自动生成一个index.html,这个不会自动更新,有时更新后需要手动删去,比较麻烦

      织梦手机模板怎么设置
  • 相关阅读:
    POJ 2002 Squares
    POJ 1840 Eqs
    POJ 1759 Garland
    UVA 572 Oil Deposits
    POJ 3278 Catch That Cow
    POJ 2488 A Knight's Journey
    UVA 699 The Falling Leaves
    [Poi1999] 原始生物
    [bzoj3033] 太鼓达人
    [bzoj1123] BLO
  • 原文地址:https://www.cnblogs.com/supe/p/9359718.html
Copyright © 2011-2022 走看看