In the new dream of the default template, in addition to the original template, more mobile phone templates, the main mobile phone templates are as follows:
index_m.htm Homepage Template
Inde_default_m.htm Channel page Template
List_default_m.htm List page Template
List_default_sg_m.htm List page Template
Article_article_m.htm Content page Template
Article_default_m.htm content Page Default Template
Search_m.htm Search Page Template
head_m.htm Top Template
Footer_m.htm Bottom Template
* Add the following code to the homepage template:
<meta http-equiv= "mobile-agent" content= "format=xhtml;url={dede:global.cfg_mobileurl/}/index.php"/>
<script type= "Text/javascript" >if (window.location.toString () indexOf (' Pref=padindex ')!=-1) {}else
{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|) Windows phone|webos|iphone|ipod| Blackberry/i.test
(navigator.useragent)) {window.location.href= "{dede:global.cfg_mobileurl/}/index.php";} else if
(/ipad/i.test (navigator.useragent)) {}else{}}catch (e) {}}}}</script>
* List page template Add the following code:
<meta http-equiv= "mobile-agent" content= "format=xhtml;url={dede:global.cfg_mobileurl/}/
List.php?tid={dede:field.id/} "/>
<script type= "Text/javascript" >if (window.location.toString () indexOf (' Pref=padindex ')!=-1) {}else
{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|) Windows phone|webos|iphone|ipod| Blackberry/i.test
(navigator.useragent)) {window.location.href= ' {dede:global.cfg_mobileurl/}/list.php?tid=
{Dede:field.id/} ';} else if (/ipad/i.test (navigator.useragent)) {}else{}}catch (e) {}}}}</script>
* Content page template Add the following code
<meta http-equiv= "mobile-agent" content= "format=xhtml;url={dede:global.cfg_mobileurl/}/
View.php?aid={dede:field.id/} "/>
<script type= "Text/javascript" >if (window.location.toString () indexOf (' Pref=padindex ')!=-1) {}else
{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|) Windows phone|webos|iphone|ipod| Blackberry/i.test
(navigator.useragent)) {window.location.href= ' {dede:global.cfg_mobileurl/}/view.php?aid=
{Dede:field.id/} ';} else if (/ipad/i.test (navigator.useragent)) {}else{}}catch (e) {}}}}</script>
The above JS is the computer site to jump to the mobile phone site code, but used to tell Baidu, mobile website address, mainly used for SEO.
PC template to add the above code, mobile phone access to the site, it will automatically jump to the phone site template.