phpmcs 图片模型文章列表获取图片组图的方法

2020-12-21 浏览:1263
phpmcs 图片模型文章列表获取图片组图的方法
评论:(0)复制地址

phpmcs 图片模型文章列表获取图片组图的方法

{pc:content action="lists" catid="$catid" num="24" order="listorder DESC" moreinfo="1" page="$page"}
              <div class="row row--gutters products" id="Product_List">
                {loop $data $r}
                <article class="column column--xs-6 column--lg-4 product">
                  <div class="product__content">
                      <a itemprop="url" class="product__image-wrapper" href="{$r[url]}" title="{$r[title]}">
                        {if $r['pictureurls']}
                            {loop string2array($r['pictureurls']) $pic_k $v}  
                            {if $pic_k>1}
                              {php break}
                            {/if}
                            <img class="product__image {if $pic_k==1}product__image--secondary{/if} lazy" data-srcset="{$v[url]}" data-src="{$v[url]}" data-default-image="{$v[url]}" alt="{$r[title]}">
                            {/loop}
                        {else}
                            <img class="product__image lazy" data-srcset="{siteurl($siteid)}/template/img/no_img.jpg" data-src="{siteurl($siteid)}/template/img/no_img.jpg" data-default-image="{siteurl($siteid)}/template/img/no_img.jpg" alt="{$r[title]}">  
                        {/if}
                      </a>
                    <header class="product__header">
                      <h2 class="product__title"> <a href="{$r[url]}" title="{$r[title]}">{$r[title]}</a> </h2>
                      <span class="product__meta product__meta--pricing">
                          <span class="product__price" itemprop="price"></span>
                      </span>
                    </header>
                  </div>
                </article>
                {/loop}
               </div>
              <div class="product-loading"> <img alt="loading indicator" class="spinner" src="data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgNDQgNDQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE1LjU0MiAxLjQ4N0EyMS41MDcgMjEuNTA3IDAgMDAuNSAyMmMwIDExLjg3NCA5LjYyNiAyMS41IDIxLjUgMjEuNSA5Ljg0NyAwIDE4LjM2NC02LjY3NSAyMC44MDktMTYuMDcyYTEuNSAxLjUgMCAwMC0yLjkwNC0uNzU2QzM3LjgwMyAzNC43NTUgMzAuNDczIDQwLjUgMjIgNDAuNSAxMS43ODMgNDAuNSAzLjUgMzIuMjE3IDMuNSAyMmMwLTguMTM3IDUuMy0xNS4yNDcgMTIuOTQyLTE3LjY1YTEuNSAxLjUgMCAxMC0uOS0yLjg2M3oiIGZpbGw9ImN1cnJlbnRDb2xvciIvPjwvc3ZnPgo="> </div>
              <nav class="pagination" role="navigation">{$new_pages}</nav>
              {/pc}


以下代码是获取前两张图片,如果需要调取全部删除即可

{if $pic_k>1}
    {php break}
{/if}


评论:(0)复制地址
发布:苗景云 | 分类:IT技术&设计 | Tags:phpmcs

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。