Skip to content

Instantly share code, notes, and snippets.

@fjm
Last active April 4, 2022 07:58
Show Gist options
  • Save fjm/028f877a12d26cb4a865 to your computer and use it in GitHub Desktop.
Save fjm/028f877a12d26cb4a865 to your computer and use it in GitHub Desktop.
ColorMeShop : カラーミーの商品一覧で現在表示しているカテゴリーの親の子カテゴリーのみのリンクを出力する #colormeshop
<{*
# カラーミーの商品一覧で現在表示しているカテゴリーの親の子カテゴリーのみのリンクを出力する
*}>
<{assign var="parentID" value=$smarty.get.cbid}>
<!-- parentID : <{parentID} -->
<{assign var="childID" value=$smarty.get.csid}>
<!-- childID : <{childID} -->
<{assign var="categoryIDs" value=$parentID,$childID}>
<!-- categoryIDs : <{$categoryIDs}> -->
<{foreach from=$category item=cate name=cate}>
<{if $cate.bid == $parentID }>
<h3><a href="<{$cate.link_url}>"><{$cate.name}></a></h3>
<ul class="list-category">
<li class="<{if $childID == 0 }>current<{/if}>">
<a href="/?mode=cate&cbid=<{$parentID}>&csid=0">
すべて
</a>
</li>
<{foreach from=$subcategory[$cate.bid] item=scate name=scate}>
<li class="<{if $scate.id == $categoryIDs }>current<{/if}>">
<a href="<{$scate.link_url}>">
<{$scate.name}>
</a>
</li>
<!-- $scate :
<{$scate|@debug_print_var:0:1000}>
-->
<{/foreach}>
</ul>
<!-- $cate :
<{$cate|@debug_print_var:0:1000}>
-->
<{/if}>
<{/foreach}>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment