联系官方销售客服

1835022288

028-61286886

开发框架 版主:迅睿框架研发组
目前用多文件字段调了图片附件,如何只显示一个
类型:迅睿CMS 更新时间:2021-07-31 09:48:43

模板标签里面

请教:目前用多文件字段调了图片附件,但是显示效果有点不好,请问怎么实现如图中  如果有两个客厅描述只显示一个

代码:

<div class="pic-box">
                                    <ul class="pic-nav clear">
                                       {loop $zutu $i $c}
                                    <li id="cate-{$i}" data-id="{$i}" class="cate-item">
                                                <a href="javascript:;">{$c.description}</a>
                                            </li>
                                        {/loop}                   
                                        </ul>
                                    <div class="pic-slide swiperContainBox">
                                        <!--轮播start-->
                                        <div class="swiper-container">
                                            <div class="swiper-wrapper" id="swiper-all">
                                            {loop $zutu $i $c}                                                                       
                                            <div class="swiper-slide img-swiper swiper-{$i}" data-id="{$i}">
                                            <img src="{dr_get_file($c.file)}" class="cases-banner" alt="{$c.title}" title="{$c.title}">
                                                            </div>
                                                            {/loop}
                                                            </div>
                                            <div class="swiper-button-prev swiper-button-white"></div>
                                            <div class="swiper-button-next swiper-button-white"></div>
                                        </div>
                                        <!--轮播end-->
                                    </div>
                                    
                                </div>

{xunruicms_img_title}URL地址相对路径:cases
模板文件相对路径:show

回帖
  • 迅睿框架技术-徐老师
    #1楼    迅睿框架技术-徐老师
    2021-03-18 16:01:45
    Chrome 0
    做一次判断
    {php $rt=[];}
    {loop $zutu $i $c}
    {if dr_in_array($c.title, $rt)}
    {php unset($zutu[$i]);}
    {/if}
    {php $rt[]=$c['title'];}
    {/loop}
    这就代码加在你图中的代码最上方,排吹重复title
  • 天枫
    #2楼    天枫
    2021-03-18 16:25:06
    Chrome 0
    迅睿框架技术-徐老师 这个显示只显示一个了,但是图片附件也跟着没有了,是不是我没加对
  • 迅睿框架技术-徐老师
    #3楼    迅睿框架技术-徐老师
    2021-03-18 16:36:43
    Chrome 0
    看看你是怎么加的,是不是按照我的要求来加的
  • 天枫
    #4楼    天枫
    2021-03-18 17:26:06
    Chrome 0
    迅睿框架技术-徐老师
    {php $rt=[];}
    {loop $zutu $i $c}
    {if dr_in_array($c.description, $rt)}
    {php unset($zutu[$i]);}
    {/if}
    {php $rt[]=$c['description'];}
    {/loop}
                                 <div class="pic-box">
                                        <ul class="pic-nav clear">
    
    {loop $zutu $i $c}
                                        <li id="cate-{$i}" data-id="{$i}" class="cate-item">
    
                                                    <a href="javascript:;">{$c.description}</a>
                                                </li>
    
                                            {/loop}                   
                                            </ul>
                                        <div class="pic-slide swiperContainBox">
                                            <!--轮播start-->
    
    
                                            <div class="swiper-container">
                                                <div class="swiper-wrapper" id="swiper-all">
                                                {loop $zutu $i $c}                                                                       
                                                <div class="swiper-slide img-swiper swiper-{$i}" data-id="{$i}">
                                                <img src="{dr_get_file($c.file)}" class="cases-banner" alt="{$c.title}" title="{$c.title}">
                                                                </div>
                                                                {/loop}
                                                                </div>
                                                <div class="swiper-button-prev swiper-button-white"></div>
                                                <div class="swiper-button-next swiper-button-white"></div>
                                            </div>
                                            <!--轮播end-->
                                        </div>
                                        
                                    </div>
  • 迅睿框架技术-徐老师
    #5楼    迅睿框架技术-徐老师
    2021-03-18 17:43:52
    Chrome 0
    {php $rt=[];}
    {loop $zutu $i $c}
    {if dr_in_array($c.title, $rt)}
    {php unset($zutu[$i]);}
    {/if}
    {php $rt[]=$c['title'];}
    {/loop}
                                 <div class="pic-box">
                                        <ul class="pic-nav clear">
    
    {loop $zutu $i $c}
                                        <li id="cate-{$i}" data-id="{$i}" class="cate-item">
    
                                                    <a  target="_blank" href="javascript:;">{$c.description}</a>
                                                </li>
    
                                            {/loop}                   
                                            </ul>
                                        <div class="pic-slide swiperContainBox">
                                            <!--轮播start-->
    
    
                                            <div class="swiper-container">
                                                <div class="swiper-wrapper" id="swiper-all">
                                                {loop $zutu $i $c}                                                                       
                                                <div class="swiper-slide img-swiper swiper-{$i}" data-id="{$i}">
                                                <img src="{dr_get_file($c.file)}" class="cases-banner" alt="{$c.title}" title="{$c.title}">
                                                                </div>
                                                                {/loop}
                                                                </div>
                                                <div class="swiper-button-prev swiper-button-white"></div>
                                                <div class="swiper-button-next swiper-button-white"></div>
                                            </div>
                                            <!--轮播end-->
                                        </div>
                                        
                                    </div>
  • 天枫
    #6楼    天枫
    2021-03-18 17:53:14
    Chrome 0
    迅睿框架技术-徐老师 没任何变化,客厅 餐厅我用的是描述标签
    description
    用你写的加过去一样文字是显示一个类型,图片也跟着只显示一个
    我调用方式是这样,看有没有问题



  • 迅睿框架技术-徐老师
    #7楼    迅睿框架技术-徐老师
    2021-03-18 17:59:07
    Chrome 0
    这样看看输出什么结果
    {php print_r($zutu);}
    {php $rt=[];}
    {loop $zutu $i $c}
    {if dr_in_array($c.title, $rt)}
    {php unset($zutu[$i]);}
    {/if}
    {php $rt[]=$c['title'];}
    {/loop}
    
    {php print_r($zutu);}
    {php print_r($rt);}
  • 天枫
    #8楼    天枫
    2021-03-18 18:01:14
    Chrome 0
    迅睿框架技术-徐老师
    Array ( [0] => Array ( [file] => 23 [title] => 1595922242298866 [description] => 客厅 ) [1] => Array ( [file] => 29 [title] => 201910090512064624 [description] => 客厅 ) [2] => Array ( [file] => 24 [title] => 1586598566689126 [description] => 卧室 ) [3] => Array ( [file] => 25 [title] => 201910090516154758 [description] => 厨房 ) [4] => Array ( [file] => 26 [title] => 201910090516159613 [description] => 次卧 ) [5] => Array ( [file] => 27 [title] => 201910090516159210 [description] => 户型图 ) [6] => Array ( [file] => 28 [title] => 201910090516156816 [description] => 餐厅 ) ) Array ( [0] => Array ( [file] => 23 [title] => 1595922242298866 [description] => 客厅 ) [1] => Array ( [file] => 29 [title] => 201910090512064624 [description] => 客厅 ) [2] => Array ( [file] => 24 [title] => 1586598566689126 [description] => 卧室 ) [3] => Array ( [file] => 25 [title] => 201910090516154758 [description] => 厨房 ) [4] => Array ( [file] => 26 [title] => 201910090516159613 [description] => 次卧 ) [5] => Array ( [file] => 27 [title] => 201910090516159210 [description] => 户型图 ) [6] => Array ( [file] => 28 [title] => 201910090516156816 [description] => 餐厅 ) ) Array ( [0] => 1595922242298866 [1] => 201910090512064624 [2] => 1586598566689126 [3] => 201910090516154758 [4] => 201910090516159613 [5] => 201910090516159210 [6] => 201910090516156816 )
  • 迅睿框架技术-徐老师
    #9楼    迅睿框架技术-徐老师
    2021-03-18 18:04:19
    Chrome 0
    {php print_r($zutu);}
    {php $rt=[];}
    {loop $zutu $i $c}
    {if dr_in_array($c.description, $rt)}
    {php unset($zutu[$i]);}
    {/if}
    {php $rt[]=$c['description'];}
    {/loop}
    
    {php print_r($zutu);}
    {php print_r($rt);}
    这样结果是什么,结果你发截图,不用发代码
    满意答案
  • 天枫
    #10楼    天枫
    2021-03-18 19:08:20
    Chrome 0
    迅睿框架技术-徐老师

  • 初次使用
    #11楼    初次使用
    2021-03-18 19:23:08
    Chrome 0
    完美了,做一个标记
  • 天枫
    #12楼    天枫
    2021-07-31 09:48:43
    Chrome 0
    @迅睿框架技术-徐老师:大体解决了,用另一种方式代替了