织梦中limit的用法详解(调用指定id下的指定稿件)

WBOY
Release: 2016-06-13 12:24:53
Original
821 people have browsed it

织梦中limit的用法详解(调用指定id下的指定文章)

limit的用法大致可以理解为:调用指定id下的指定文章。

下面为代码片段,需要的朋友自行拿去:

<span style="color: #000000;">{dede:arclist typeid='6' row='1' limit='0,1'}</span><span style="color: #0000ff;">  <span style="color: #800000;">li</span><span style="color: #0000ff;">></span><span style="color: #0000ff;">    <span style="color: #800000;">a </span><span style="color: #ff0000;">href</span><span style="color: #0000ff;">="[field:arcurl/]"</span><span style="color: #ff0000;"> target</span><span style="color: #0000ff;">="_blank"</span><span style="color: #ff0000;"> rel</span><span style="color: #0000ff;">="nofollow"</span> <span style="color: #0000ff;">></span>      <span style="color: #0000ff;"><span style="color: #800000;">img </span><span style="color: #ff0000;">class</span><span style="color: #0000ff;">="zhuanjia_img"</span><span style="color: #ff0000;"> src</span><span style="color: #0000ff;">=""</span> <span style="color: #0000ff;">/></span><span style="color: #0000ff;">    </span><span style="color: #800000;">a</span><span style="color: #0000ff;">></span><span style="color: #0000ff;">    <span style="color: #800000;">h3</span><span style="color: #0000ff;">><span style="color: #800000;">a </span><span style="color: #ff0000;">href</span><span style="color: #0000ff;">="[field:arcurl/]"</span><span style="color: #ff0000;"> target</span><span style="color: #0000ff;">="_blank"</span><span style="color: #0000ff;">></span>[field:title/]<span style="color: #0000ff;"></span><span style="color: #800000;">a</span><span style="color: #0000ff;">></span><span style="color: #800000;">h3</span><span style="color: #0000ff;">></span>    <span style="color: #0000ff;"><span style="color: #800000;">p</span><span style="color: #0000ff;">><span style="color: #800000;">span</span><span style="color: #0000ff;">></span>简介:<span style="color: #0000ff;"></span><span style="color: #800000;">span</span><span style="color: #0000ff;">></span>[field:description function="cn_substr(@me,55)"/]...<span style="color: #0000ff;"><span style="color: #800000;">a </span><span style="color: #ff0000;">style</span><span style="color: #0000ff;">="color:#C2316C;"</span><span style="color: #ff0000;"> href</span><span style="color: #0000ff;">="[field:arourl/]"</span><span style="color: #0000ff;">></span>【详情】<span style="color: #0000ff;"></span><span style="color: #800000;">a</span><span style="color: #0000ff;">></span><span style="color: #800000;">p</span><span style="color: #0000ff;">></span><span style="color: #0000ff;">    <span style="color: #800000;">div </span><span style="color: #ff0000;">class</span><span style="color: #0000ff;">="z11"</span><span style="color: #0000ff;">></span><span style="color: #0000ff;">      <span style="color: #800000;">div </span><span style="color: #ff0000;">class</span><span style="color: #0000ff;">="gz1"</span><span style="color: #0000ff;">><span style="color: #800000;">a </span><span style="color: #ff0000;">href</span><span style="color: #0000ff;">="[field:arcurl/]"</span><span style="color: #ff0000;">  rel</span><span style="color: #0000ff;">="nofollow"</span> <span style="color: #0000ff;">></span>详细介绍<span style="color: #0000ff;"></span><span style="color: #800000;">a</span><span style="color: #0000ff;">></span><span style="color: #800000;">div</span><span style="color: #0000ff;">></span><span style="color: #0000ff;">      <span style="color: #800000;">div </span><span style="color: #ff0000;">class</span><span style="color: #0000ff;">="gz2"</span><span style="color: #0000ff;">><span style="color: #800000;">a </span><span style="color: #ff0000;">href</span><span style="color: #0000ff;">="javascript:void(0)"</span><span style="color: #ff0000;"> onclick</span><span style="color: #0000ff;">="openChat()"</span><span style="color: #ff0000;"> target</span><span style="color: #0000ff;">="_blank"</span><span style="color: #ff0000;">  rel</span><span style="color: #0000ff;">="nofollow"</span> <span style="color: #0000ff;">></span>在线咨询<span style="color: #0000ff;"></span><span style="color: #800000;">a</span><span style="color: #0000ff;">></span><span style="color: #800000;">div</span><span style="color: #0000ff;">></span>    <span style="color: #0000ff;"></span><span style="color: #800000;">div</span><span style="color: #0000ff;">></span>  <span style="color: #0000ff;"></span><span style="color: #800000;">li</span><span style="color: #0000ff;">></span><span style="color: #000000;">{/dede:arclist}</span></span></span></span></span></span></span></span></span></span></span></span></span></span>
Copy after login

上述代码调用了id为6下的栏目1篇(从第一篇开始数,取1篇文章)

limit是一个灵活的取数标签,作用是取出指定的文章。<br />limit='0,1',表示从第一个文章开始,取1篇文章。<br />limit='1,1',表示从第二个文章开始,取1篇文章。<br />limit='2,3',表示从第三个文章开始,取3篇文章。<br />以此类推,用法有点类似row标签,但是比row更加灵活。
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template