1차 카테고리 하단에 2차카테고리 출력 하고 십습니다
본문
1차카테고리 크릭하면은 1차카테고리가 사라지고 2차카테고리가 출력되는데 이거를
1차카테고리 바로 밑에 해당 2차카테고리 출력 되게 하고 십습니다
1차카테고리 선탠하지 않을 경우에는 전체 2차카테고리 다출력시키고 십습니다.
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$btn3 = (isset($wset['btn3']) && $wset['btn3']) ? $wset['btn3'] : 'black';
?>
<style>
.nav>li>a {
position: relative;
display: block;
padding: 8px 25px !important;
}
</style>
<aside>
<?php if($nav_title) { ?>
<div class="list-nav">
<span class="page-nav pull-right text-muted">
<i class="fa fa-home"></i> 홈
<?php
if($is_nav) {
$nav_cnt = count($nav);
for($i=0;$i < $nav_cnt; $i++) {
$nav[$i]['cnt'] = ($nav[$i]['cnt']) ? '('.number_format($nav[$i]['cnt']).')' : '';
?>
>
<a href="./list.php?ca_id=<?php echo $nav[$i]['ca_id'];?>">
<span class="text-muted"><?php echo $nav[$i]['name'];?><?php echo $nav[$i]['cnt'];?></span>
</a>
<?php } ?>
<?php } else {
echo ($page_nav1) ? ' > '.$page_nav1 : '';
echo ($page_nav2) ? ' > '.$page_nav2 : '';
echo ($page_nav3) ? ' > '.$page_nav3 : '';
}
?>
</span>
<h3 class="div-title-underbar">
<span class="div-title-underbar-bold font-22 border-<?php echo (isset($wset['ncolor']) && $wset['ncolor']) ? $wset['ncolor'] : 'color';?>">
<b><?php echo $nav_title;?></b>
</span>
</h3>
</div>
<?php } ?>
<?php if($is_cate) {
$ca_cnt = count($cate);
$wset['ctype'] = (isset($wset['ctype']) && $wset['ctype']) ? $wset['ctype'] : '';
$wset['mctab'] = (isset($wset['mctab']) && $wset['mctab']) ? $wset['mctab'] : 'color';
//탭
$category_tabs = (isset($wset['tab']) && $wset['tab']) ? $wset['tab'] : '';
switch($category_tabs) {
case '-top' : $category_tabs .= ' tabs-'.$wset['mctab'].'-top'; break;
case '-bottom' : $category_tabs .= ' tabs-'.$wset['mctab'].'-bottom'; break;
case '-line' : $category_tabs .= ' tabs-'.$wset['mctab'].'-top tabs-'.$wset['mctab'].'-bottom'; break;
case '-btn' : $category_tabs .= ' tabs-'.$wset['mctab'].'-bg'; break;
case '-box' : $category_tabs .= ' tabs-'.$wset['mctab'].'-bg'; break;
default : $category_tabs .= ($wset['tabline']) ? ' tabs-'.$wset['mctab'].'-top' : ' trans-top'; break;
}
$cate_w = ($wset['ctype'] == "2") ? apms_bunhal($ca_cnt, $wset['bunhal']) : '';
?>
<div class="list-category<?php echo (G5_IS_MOBILE) ? ' list-category-mobile' : '';?>">
<div class="tabs div-tab<?php echo $category_tabs;?> hidden-xs">
<ul class="nav nav-tabs<?php echo ($wset['ctype'] == "1") ? ' nav-justified' : '';?><?php echo ($cate_w) ? ' text-center' :'';?>">
<?php for ($i=0; $i < $ca_cnt; $i++) { ?>
<li class="<?php echo ($cate[$i]['on']) ? 'active' : '';?>">
<a href="./list.php?ca_id=<?php echo urlencode($cate[$i]['ca_id']);?>">
<?php echo $cate[$i]['name'];?>
</a>
</li>
<?php } ?>
</ul>
</div>
<div class="dropdown visible-xs">
<a id="categoryLabel" data-target="#" href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" class="btn btn-<?php echo $wset['mctab'];?> btn-block">
<?php echo ($ca_id) ? $ca['ca_name'] : '카테고리';?>(<?php echo number_format($total_count);?>)
<span class="caret"></span>
</a>
<ul class="" role="menu" aria-labelledby="categoryLabel">
<?php for ($i=0; $i < $ca_cnt; $i++) { ?>
<li class="<?php echo ($cate[$i]['on']) ? 'selected' : '';?>">
<a href="./list.php?ca_id=<?php echo urlencode($cate[$i]['ca_id']);?>"><?php echo $cate[$i]['name'];?></a>
</li>
<?php } ?>
</ul>
</div>
</div>
<?php } ?>
</aside>