dede手机端仿站标签合集

PC跳转标签

  • 首页跳转
  1. <meta name="mobile-agent" content="format=xhtml;url=http://m.dadongjie.com/">
  2.     <script type="text/javascript">
  3.     if (window.location.toString().indexOf('pref=padindex') != -1) {} else {
  4.         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))) {
  5.             if (window.location.href.indexOf("?mobile") < 0) {
  6.                 try {
  7.                     if (/Android|Windows Phone|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
  8.                         window.location.href = "http://m.dadongjie.com/";
  9.                     } else if (/iPad/i.test(navigator.userAgent)) {} else {}
  10.                 } catch (e) {}
  11.             }
  12.         }
  13.     }
  14.     </script>

 

  • 列表跳转
  1. <meta name="mobile-agent" content="format=xhtml;url=http://m.dadongjie.com/list.php?tid={dede:field.id/}">
  2. <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="http://m.dadongjie.com/list.php?tid={dede:field.id/}";}else if(/iPad/i.test(navigator.userAgent)){}else{}}catch(e){}}}}</script>
  • 内容跳转
  1. <meta name="mobile-agent" content="format=xhtml;url=http://m.dadongjie.com/view.php?aid={dede:field.id/}">
  2. <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="http://m.dadongjie.com/view.php?aid={dede:field.id/}";}else if(/iPad/i.test(navigator.userAgent)){}else{}}catch(e){}}}}</script>

 

三大标签

  • 首页
  1. <title>{dede:global.cfg_webname/} - 手机版</title>
  2. <meta name="keywords" content="{dede:global.cfg_keywords/}" />
  3. <meta name="description" content="{dede:global.cfg_description/}" />
  • 列表页
  1. <title>{dede:field.title/}_{dede:global.cfg_webname/}</title>
  2. <meta name="keywords" content="{dede:field.keywords/}" />
  3. <meta name="description" content="{dede:field.description function='html2text(@me)'/}" />
  • 内容页
  1. <title>{dede:field.title/}_{dede:global.cfg_webname/}</title>
  2. <meta name="keywords" content="{dede:field.keywords/}" />
  3. <meta name="description" content="{dede:field.description function='html2text(@me)'/}" />

 

循环标签

  • 导航循环
  1. <ul>
  2.     <li> <a href="index.php">首页</a></li>
  3.     {dede:channel type='top' row='10'}
  4.     <li> <a href="list.php?tid=[field:id/]">[field:typename/]</a></li>
  5.     {/dede:channel}
  6. </ul>

包含标签:

[field:id/]:栏目编号

[field:typename/]:栏目名称

 

  • 新闻循环
  1. <ul class="lee">
  2.     {dede:arclist row='5'}
  3.     <li>
  4.         <a href="view.php?aid=[field:id/]">
  5.             <img src="[field:litpic/]">
  6.             <p>[field:title /]</p>
  7.         </a>
  8.     </li>
  9.     {/dede:arclist}
  10. </ul>

包含标签:

[field:id/]:内容id(注意区别前面是view.php,还是list.php)

[field:litpic/]:图片地址

[field:title /] :内容标题

 

李金龙

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: