article.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <?php
  2. $view
  3. ->set('name', 'article')
  4. ->set('title', 'main/content.view#name')
  5. ->import('inc/head')
  6. ->fetch('body@test', '1')
  7. ->fetch(array('.common-tit span', 0), 'main/content.view#sname')
  8. ->fetch(array('.common-tit em', 0), 'main/content.view#pdate_string')
  9. ->fetch(array('.common-tit span', 1), 'main/content.view#sname')
  10. ->fetch(array('.common-tit em', 1), 'main/content.view#pdate_string')
  11. ->fetch(array('.article-wrapper img@src', 2), 'main/content.view#pic')
  12. ->fetch(array('.article-wrapper img@style', 2), 'main/content.view_pic', 'none')
  13. ->fetch(array('.article-content .article', 0), 'main/content.view#content')
  14. ->fetch(array('.btn-link@data-clipboard-text', 0), 'main/content.view#link')
  15. # 页面上部视频 仅限视频模板
  16. ->fetch(array('.video-module@style', 0), 'main/content.view_video_1', 'none')
  17. ->fetch(array('.article-wrapper img@src', 0), 'main/content.view#pic')
  18. ->fetch(array('.article-wrapper img@src', 1), 'main/content.view#pic')
  19. ->fetch(array('.icon-play@data-url', 0), 'main/content.view#video_link')
  20. # 页面下部视频 仅限除视频之外的模板
  21. ->fetch(array('.article-video@style', 0), 'main/content.view_video_2', 'none')
  22. ->fetch(array('.article-video img@src', 0), 'main/content.view#content_video_pic')
  23. ->fetch(array('.article-video img@src', 1), 'main/content.view#content_video_pic')
  24. ->fetch(array('.icon-play@data-url', 1), 'main/content.view#video_link')
  25. # 标签
  26. ->fetch('.tags h5', 'main/content.view#tag_name')
  27. ->fetch('.tags@style', 'main/content.view_tag', 'none')
  28. ->loop
  29. (
  30. '.tags li',
  31. 'main/content.view_tag',
  32. array
  33. (
  34. 'a|0' => array
  35. (
  36. 'href' => '$v.link',
  37. 'title' => '$v.name',
  38. 'html' => '$v.name',
  39. ),
  40. )
  41. )
  42. # 热门推荐
  43. ->loop
  44. (
  45. '.article-recs li',
  46. 'main/content.hot',
  47. array
  48. (
  49. 'a|0' => array
  50. (
  51. 'href' => '$v.link',
  52. 'title' => '$v.name',
  53. 'img' => array
  54. (
  55. 'src' => '$v.pic',
  56. 'alt' => '$v.name',
  57. ),
  58. ),
  59. 'a|1' => array
  60. (
  61. 'href' => '$v.link',
  62. 'title' => '$v.name',
  63. 'html' => '$v.name',
  64. ),
  65. )
  66. )
  67. ->fetch('.article-recs@style', 'main/content.hot', 'none')
  68. # 广告
  69. ->loop
  70. (
  71. '.ad-swiper .swiper-slide',
  72. 'main/content.ad|key=news_view_ad&name=资讯详情页广告',
  73. array
  74. (
  75. 'a' => array
  76. (
  77. 'href' => '$v.link',
  78. 'title' => '$v.name',
  79. ),
  80. 'img' => array
  81. (
  82. 'src' => '$v.pic',
  83. 'alt' => '$v.name',
  84. ),
  85. )
  86. )
  87. ->fetch('.ad-swiper@style', 'main/content.ad?key=news_view_ad&name=资讯详情页广告', 'none')
  88. ->import('inc/foot')
  89. ->display();