DEDECMS Dream Mobile Phone Station jump Template Setup Example

Source: Internet
Author: User
Tags lenovo

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 ") &lt;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 ") &lt;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 ") &lt;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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.