一切天空 發表於 2023-12-27 00:00:00

dede调用其他栏目的文章或者缩略图列表且有分页效果的方法

<p>
        <span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>提问i:我做一个网站,有5个栏目,第5个栏目想把前4个栏目的文章都调用一下,搞一个汇总的文章集合。发现用arclist调用不能设置pagesize的属性,从而不能给文章分页。然而list貌似不能调用同级栏目的文章,现在该怎么实现呢? </span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>回答:你的第5个栏目模版顶部调用dedeajax2.js </span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>在head部分加上 </span></p>
<blockquote>
        <ol class="dp-c">
<li class="alt">
                        <span><span>  </span>
</li>
        </ol>
</blockquote>
<p>
        <br><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>栏目5分页列表标签: </span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>
         </p>
<div class="msgheader" style='margin: 3px auto 0px; padding: 0px 3px; outline: none; line-height: 21.6px; clear: both; border-width: 1px; border-style: solid; border-color: rgb(0, 153, 204); background: rgb(246, 251, 255); overflow: hidden; font-family: tahoma, arial, "Microsoft YaHei";'>
        <div class="right">
                <span><u>复制代码</u></span>
</div>
        代码如下:</div>
<div class="msgborder" id="phpcode10" style='margin: 0px auto 3px; padding: 0px 3px; outline: none; line-height: 25.2px; font-size: 14px; clear: both; border-right: 1px solid rgb(0, 153, 204); background: rgb(221, 237, 251); overflow: hidden; border-left: 1px solid rgb(0, 153, 204); word-break: break-all; border-bottom: 1px solid rgb(0, 153, 204); word-wrap: break-word; font-family: tahoma, arial, "Microsoft YaHei";'>
        <br>
        {dede:arclist typeid='1,2,3,4' row='100' titlelen='50' infolen='100' imgwidth='120' imgheight='40' listtype='all' orderby='pubdate' keyword='' channelid='1' tagid='dedecms' pagesize='20'} <br>
         </div>
<br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>分页标签加上{dede:arcpagelist tagid='dedecms'/} </span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>调用其他栏目文章列表 用arclist 标签 </span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>一个演示标签: </span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><div class="msgheader" style='margin: 3px auto 0px; padding: 0px 3px; outline: none; line-height: 21.6px; clear: both; border-width: 1px; border-style: solid; border-color: rgb(0, 153, 204); background: rgb(246, 251, 255); overflow: hidden; font-family: tahoma, arial, "Microsoft YaHei";'>
        <div class="right">
                <span><u>复制代码</u></span>
</div>
        代码如下:</div>
<div class="msgborder" id="phpcode11" style='margin: 0px auto 3px; padding: 0px 3px; outline: none; line-height: 25.2px; font-size: 14px; clear: both; border-right: 1px solid rgb(0, 153, 204); background: rgb(221, 237, 251); overflow: hidden; border-left: 1px solid rgb(0, 153, 204); word-break: break-all; border-bottom: 1px solid rgb(0, 153, 204); word-wrap: break-word; font-family: tahoma, arial, "Microsoft YaHei";'>
        <br>
        {dede:arclist row=10 titlelen=50 typeid='1,3,4,5,6,7,8,9' noflag=h} <br>
        //表示调用10条 标题长度为50 频道id为13456789 非头条的信息 <br>
        &lt;div class="indexbox"&gt; <br>
        @me = (strpos(@me['litpic'],'defaultpic') ? "" : "&lt;a style='float:left' href='{@me['arcurl']}'&gt;&lt;img target='_blank'&gt;<u>图片</u>则调用缩略图 没有则不显示 <br>
        &lt;h2&gt;&lt;a href=""&gt;&lt;/a&gt; <br>
         <br>
        $ntime = time(); <br>
        $oneday = 3600 * 24; <br>
        if(($ntime - @me)&lt;$oneday) @me = "&lt;span style='color:red;font-size:12px;'&gt;new !&lt;/span&gt;"; <br>
        else @me = ""; <br>
         <br>
        //24小时内发布的文章加NEW!字样 <br>
        &lt;/h2&gt; <br>
        {/dede:arclist} </div>
<br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>CSS样式自己去写。</span>
頁: [1]
查看完整版本: dede调用其他栏目的文章或者缩略图列表且有分页效果的方法