当前位置: 代码迷 >> Web前端 >> 织梦(dedecms)仿站课程第十三讲—特定栏目调用
  详细解决方案

织梦(dedecms)仿站课程第十三讲—特定栏目调用

热度:7319   发布时间:2013-02-26 00:00:00.0
织梦(dedecms)仿站教程第十三讲—特定栏目调用
今天这一讲,我们要讲一下特定栏目的调用,我们打开index.htm文档,往下看代码:
  1. <DIV class=title2>
  2. <H3>拳击视频</H3>
  3. <DIV class=more><A href="http://www.quanji.cn/movie"><IMG src="{dede:global.cfg_templets_skin/}/images/more.gif"></A></DIV></DIV>
  4. <DIV class=left_a>
  5. <UL>
  6.   <LI><A title="阿米尔.卡汗 VS 朱达(尤达赫)(2011-07-24)" href="http://www.quanji.cn/movie/1/575" target=_blank>阿米尔.卡汗 VS  朱达(尤达赫)(2011</A>
  7.   <LI><A title="小克里琴科 VS 海耶(2011-07-03)" href="http://www.quanji.cn/movie/1/615" target=_blank>小克里琴科 VS 海耶(2011-07-03)</A>
  8.   <LI><A title="帕本 VS 卡斯特罗(2011-06-25)" href="http://www.quanji.cn/movie/1/638" target=_blank>帕本 VS 卡斯特罗(2011-06-25)</A>
  9.   <LI><A title="科克兰德 VS 沙普(2011-06-25)" href="http://www.quanji.cn/movie/1/637" target=_blank>科克兰德 VS 沙普(2011-06-25)</A>
  10.   <LI><A title="米汉 VS 克比(2011-06-24)" href="http://www.quanji.cn/movie/1/636" target=_blank>米汉 VS 克比(2011-06-24)</A>
  11.   <LI><A title="瓦拉德兹 VS 弗洛雷斯(2011-06-24)" href="http://www.quanji.cn/movie/1/635" target=_blank>瓦拉德兹 VS 弗洛雷斯(2011-06-24)</A>
  12.   <LI><A title="卡瓦纳 VS 维洛比(2011-06-24)" href="http://www.quanji.cn/movie/1/634" target=_blank>卡瓦纳 VS 维洛比(2011-06-24)</A>
  13.   <LI><A title="霍诺里奥 VS 佩雷兹(2011-06-19)" href="http://www.quanji.cn/movie/1/633" target=_blank>霍诺里奥 VS 佩雷兹(2011-06-19)</A>
  14.   <LI><A title="穆雷 VS 布莱克维尔(2011-06-19)" href="http://www.quanji.cn/movie/1/631" target=_blank>穆雷 VS 布莱克维尔(2011-06-19)</A>
  15.   <LI><A title="克罗拉 VS 德.卢卡(2011-06-19)" href="http://www.quanji.cn/movie/1/630" target=_blank>克罗拉 VS 德.卢卡(2011-06-19)</A>
  16. </LI>
  17. </UL>
  18. </DIV>
修改为织梦调用特定栏目内容的代码:
  1. <DIV class=title2>
  2. {dede:type typeid='1'}<H3>[field:typename /]</H3>{/dede:type}  
  3. <DIV class=more><A href="{dede:type typeid='1'}[field:typelink /]{/dede:type}"><IMG src="{dede:global.cfg_templets_skin/}/images/more.gif"></A></DIV></DIV>
  4. <DIV class=left_a>
  5. <UL>
  6. {dede:arclisttypeid='1' row='10' titlelen='30'}  
  7.   <LI><A title="[field:title/]" href="[field:arcurl/]" target=_blank>[field:title/]</A>
  8. {/dede:arclist}  
  9. </LI>
  10. </UL>
  11. </DIV>
代码解释:
第二行:调用栏目ID为1的栏目名称。
第三行:调用栏目ID为1的栏目链接地址。
标签type的详细解释参考http://help.dedecms.com/v53/archives/tag/global/type/
第6行到第8行是我们熟悉的arclist标签。只是多了一个typeid='1',指调用栏目ID为1 的栏目的内容。福星网络(fuxing5.com)仍然建议大家把这个标签学习一下,因为这个标签用处是很大的。可参考官方的手册:http://help.dedecms.com/v53/archives/tag/global/arclist/
接来我们看前台,接下来是又是调用一个特定栏目,参考上面的教程来做,以后这些调用特定栏目文章的代码我们将跳过去。不再重复讲了。参照本讲教程就可以做的栏目有:比赛下载、拳击文章。我们参考本讲教程,修改这两块的代码。修改完成后,我们看下前台:
 
 
好了,这一讲就结束了,我们下一讲再见!
凡标识为福星网络原创的内容系福星网络版权内容,转载请注时来源于热转印纸(www.huylin.com)。谢谢合作!
  相关解决方案