質問 > その他 > 横4列画像表示 |
その他
スレッド表示 | 新しいものから | 前のトピック | 次のトピック | 下へ |
投稿者 | スレッド |
---|---|
greanpice |
投稿日時: 2012/6/12 17:45
対応状況: −−−
|
長老 登録日: 2011/7/12 居住地: 投稿: 180 |
横4列画像表示 商品一覧画面から横4列画像を表示させましたが、
下記ソースですと、最後尾のない商品も出力されてしまいます。 たとえば、7件なら残りの1件は表示させないようにすることは可能でしょうか?? <!--{section name=cnt loop=$arrProducts step=4}--> <div class="item-line" <!-- ▼1つめの商品 --> <!--{assign var=id value=$arrProducts[cnt].product_id}--> <div class="item-box-wrap"> <!--商品写真--> <div class="item-box-photo"> <a href="<!--{$smarty.const.DETAIL_P_HTML}--><!--{$arrProducts[cnt].product_id}-->"><!--商品写真--><img src="<!--{$smarty.const.IMAGE_SAVE_URL|sfTrimURL}-->/<!--{$arrProducts[cnt].main_list_image}-->" alt="<!--{$arrProducts[cnt].name|escape}-->" /></a> </div> <!--商品名--> <h3> <a href=">!--{$smarty.const.DETAIL_P_HTML}--><!--{$arrProducts[cnt].product_id}-->"><!--{$arrProducts[cnt].name|escape}--></a> </h3> <!--商品価格--> <div class="item-box-price"> <!--{if $arrProducts[cnt].price02_min == $arrProducts[cnt].price02_max}--> <!--{$arrProducts[cnt].price02_min|sfPreTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}--> <!--{else}--> <!--{$arrProducts[cnt].price02_min|sfPreTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}-->〜<!--{$arrProducts[cnt].price02_max|sfPreTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}--> <!--{/if}-->円 </div> <!--売り切れの場合--> <!--{if $arrProducts[cnt].stock_max == 0 && $arrProducts[cnt].stock_unlimited_max != 1}--> <div class="item-box-soldout"> 申し訳ございませんが、只今品切れ中です。 </div> <!--{/if}--> <!--商品コメント--> <div class="item-box-comment"> <!--{$arrProducts[cnt].main_list_comment|escape|nl2br}--> </div> </div> <!-- ▲1つめの商品 --> <!-- ▼2つめの商品 --> <!--{assign var=cnt4 value=`$smarty.section.cnt.iteration*$smarty.section.cnt.step-3` }--> <!--{if $arrProducts[$cnt4].product_id}--> <div class="item-box-wrap"> <!--商品写真--> <div class="item-box-photo"> <a href="<!--{$smarty.const.DETAIL_P_HTML}--><!--{$arrProducts[$cnt4].product_id}-->"><img src="<!--{$smarty.const.IMAGE_SAVE_URL|sfTrimURL}-->/<!--{$arrProducts[$cnt4].main_list_image}-->" alt="<!--{$arrProducts[$cnt4].name|escape}-->" /></a> </div> <!--商品名--> <h3> <a href="<!--{$smarty.const.DETAIL_P_HTML}--><!--{$arrProducts[$cnt4].product_id}-->"><!--{$arrProducts[$cnt4].name|escape}--></a> </h3> <!--商品価格--> <div class="item-box-price"> <!--{if $arrProducts[$cnt4].price02_min == $arrProducts[$cnt4].price02_max}--> <!--{$arrProducts[$cnt4].price02_min|sfPreTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}--> <!--{else}--> <!--{$arrProducts[$cnt4].price02_min|sfPreTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}-->〜<!--{$arrProducts[$cnt4].price02_max|sfPreTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}--> <!--{/if}-->円 </div> <!--売り切れの場合--> <!--{if $arrProducts[$cnt4].stock_max == 0 && $arrProducts[$cnt4].stock_unlimited_max != 1}--> <div class="item-box-soldout"> 申し訳ございませんが、只今品切れ中です。 </div> <!--{/if}--> <!--商品コメント--> <div class="item-box-comment"> <!--{$arrProducts[$cnt4].main_list_comment|escape|nl2br}--> </div> </div> <!--{/if}--> <!-- ▲2つめの商品 --> <!-- ▼3つめの商品 --> <!--{assign var=cnt3 value=`$smarty.section.cnt.iteration*$smarty.section.cnt.step-2` }--> <!--{if $arrProducts[$cnt3].product_id}--> <div class="item-box-wrap"> <!--商品写真--> <div class="item-box-photo"> <a href="<!--{$smarty.const.DETAIL_P_HTML}--><!--{$arrProducts[$cnt3].product_id}-->"><img src="<!--{$smarty.const.IMAGE_SAVE_URL|sfTrimURL}-->/<!--{$arrProducts[$cnt3].main_list_image}-->" alt="<!--{$arrProducts[$cnt3].name|escape}-->" /></a> </div> <!--商品名--> <h3> <a href="<!--{$smarty.const.DETAIL_P_HTML}--><!--{$arrProducts[$cnt3].product_id}-->"><!--{$arrProducts[$cnt3].name|escape}--></a> </h3> <!--商品価格--> <div class="item-box-price"> <!--{if $arrProducts[$cnt3].price02_min == $arrProducts[$cnt3].price02_max}--> <!--{$arrProducts[$cnt3].price02_min|sfPreTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}--> <!--{else}--> <!--{$arrProducts[$cnt3].price02_min|sfPreTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}-->〜<!--{$arrProducts[$cnt3].price02_max|sfPreTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}--> <!--{/if}-->円 </div> <!--売り切れの場合--> <!--{if $arrProducts[$cnt3].stock_max == 0 && $arrProducts[$cnt3].stock_unlimited_max != 1}--> <div class="item-box-soldout"> 申し訳ございませんが、只今品切れ中です。 </div> <!--{/if}--> <!--商品コメント--> <div class="item-box-comment"> <!--{$arrProducts[$cnt3].main_list_comment|escape|nl2br}--> </div> </div> <!--{/if}--> <!-- ▲3つめの商品 --> <!-- ▼4つめの商品 --> <!--{assign var=cnt2 value=`$smarty.section.cnt.iteration*$smarty.section.cnt.step-1` }--> <!--{if $arrProducts[$cnt2].product_id}--> <div class="item-box-wrap-end"> <!--商品写真--> <div class="item-box-photo"> <a href="<!--{$smarty.const.DETAIL_P_HTML}--><!--{$arrProducts[$cnt2].product_id}-->"><img src="<!--{$smarty.const.IMAGE_SAVE_URL|sfTrimURL}-->/<!--{$arrProducts[$cnt2].main_list_image}-->" alt="<!--{$arrProducts[$cnt2].name|escape}-->" /></a> </div> <!--商品名--> <h3> <a href="<!--{$smarty.const.DETAIL_P_HTML}--><!--{$arrProducts[$cnt2].product_id}-->"><!--{$arrProducts[$cnt2].name|escape}--></a> </h3> <!--商品価格--> <div class="item-box-price"> <!--{if $arrProducts[$cnt2].price02_min == $arrProducts[$cnt2].price02_max}--> <!--{$arrProducts[$cnt2].price02_min|sfPreTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}--> <!--{else}--> <!--{$arrProducts[$cnt2].price02_min|sfPreTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}-->〜<!--{$arrProducts[$cnt2].price02_max|sfPreTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}--> <!--{/if}-->円 </div> <!--売り切れの場合--> <!--{if $arrProducts[$cnt2].stock_max == 0 && $arrProducts[$cnt2].stock_unlimited_max != 1}--> <div class="item-box-soldout"> 申し訳ございませんが、只今品切れ中です。 </div> <!--{/if}--> <!--商品コメント--> <div class="item-box-comment"> <!--{$arrProducts[$cnt2].main_list_comment|escape|nl2br}--> </div> </div> <!--{/if}--> <!-- ▲4つめの商品 --> </div> <!--{/section}--> |
DELIGHT |
投稿日時: 2012/6/13 12:28
対応状況: −−−
|
仙人 登録日: 2010/2/3 居住地: 熊本県・九州・長野県・関東甲信越 投稿: 572 |
Re: 横4列画像表示 いろいろ方法があると思うのですが、
ソースをみたところ各商品タグを出力する前に <!--{if $arrProducts[cnt].product_id}--> 商品出力部分 <!--{/if}--> という感じでIDがあったら出力するみたいにしたら簡単だと思いますよ。
|
スレッド表示 | 新しいものから | 前のトピック | 次のトピック | トップ |