<div class="info-container">
<div class="info-container-title">
<h2>新闻资讯 <?php echo $rs['sort_name']; ?> 无法读取</h2>
</div>
<div class="info-container-list clearfix">
<div class="info-listItem">
<div class="info-listItem-title">设计知识<?php echo $rs['sort_name']; ?>无法读取</div>
<dl class="info-listItem-list">
<?php if(is_array($__LIST__) || $__LIST__ instanceof \think\Collection || $__LIST__ instanceof \think\Paginator): $i = 0; $__LIST__ = $__LIST__;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$rs): $mod = ($i % 2 );++$i;?>
<?php if($i==1): ?>
<dt>
<a href="<?php echo $rs['url']; ?>" target="_blank"><img onerror="this.src='<?php echo config('view_replace_str.__STATIC__'); ?>/images/nopic.png'" src="<?php echo $rs['picurl']; ?>">
<span><?php echo $rs['title']; ?></span>
</a>
</dt>
<?php else: ?>
<dd><a href="<?php echo $rs['url']; ?>" target="_blank"><?php echo $rs['title']; ?></a></dd>
<?php endif; ?>
<?php endforeach; endif; else: echo "" ;endif; ?>
</dl>
<a href="<?php echo $rs['sort_url']; ?>" class="info-more">查看更多</a>
</div>
<div class="info-listItem">
<div class="info-listItem-title"><?php echo $rs['sort_name']; ?> 可以读取栏目信息</div>
<dl class="info-listItem-list">
<?php if(is_array($__LIST__) || $__LIST__ instanceof \think\Collection || $__LIST__ instanceof \think\Paginator): $i = 0; $__LIST__ = $__LIST__;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$rs): $mod = ($i % 2 );++$i;?>
<?php if($i==1): ?>
<dt>
<a href="<?php echo $rs['url']; ?>" target="_blank"><img onerror="this.src='<?php echo config('view_replace_str.__STATIC__'); ?>/images/nopic.png'" src="<?php echo $rs['picurl']; ?>">
<span><?php echo $rs['title']; ?></span>
</a>
</dt>
<?php else: ?>
<dd><a href="<?php echo $rs['url']; ?>" target="_blank"><?php echo $rs['title']; ?></a></dd>
<?php endif; ?>
<?php endforeach; endif; else: echo "" ;endif; ?>
</dl>
<a href="<?php echo $rs['sort_url']; ?>" class="info-more">查看更多</a>
</div>
<div class="info-listItem">
<div class="info-listItem-title"><?php echo $rs['sort_name']; ?></div>
<dl class="info-listItem-list">
<?php if(is_array($__LIST__) || $__LIST__ instanceof \think\Collection || $__LIST__ instanceof \think\Paginator): $i = 0; $__LIST__ = $__LIST__;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$rs): $mod = ($i % 2 );++$i;?>
<?php if($i==1): ?>
<dt>
<a href="<?php echo $rs['url']; ?>" target="_blank"><img onerror="this.src='<?php echo config('view_replace_str.__STATIC__'); ?>/images/nopic.png'" src="<?php echo $rs['picurl']; ?>">
<span><?php echo $rs['title']; ?></span>
</a>
</dt>
<?php else: ?>
<dd><a href="<?php echo $rs['url']; ?>" target="_blank"><?php echo $rs['title']; ?></a></dd>
<?php endif; ?>
<?php endforeach; endif; else: echo "" ;endif; ?>
</dl>
<a href="<?php echo $rs['sort_url']; ?>" class="info-more">查看更多</a>
</div>
</div>
</div>
以上方法只能读取一个栏目的,如何实现通过标签设置,指定对应的三个栏目或多个栏目如下图效果:【目的是模块化】
求高手指点!!!
<?php if(is_array($__LIST__) || $__LIST__ instanceof \think\Collection || $__LIST__ instanceof \think\Paginator): $i = 0; $__LIST__ = $__LIST__;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$rs): $mod = ($i % 2 );++$i;?> 是加在这里面吗?如何加进来呢?
你参考默认的模板.增加参数 where="fid=10,12,44" 这样