게시판 메뉴질문드립니다.
본문
해당 게시판을 클릭하면 해당 메뉴리스트만 보이게 하고싶습니다.
<?
switch($bo_table){
case "product01_1" :
$main_menu = 'aaa';
$sub_menu = 'aaa-q';
$sub_menu2 = 'aaa-w';
break;
case "product02_1" :
$main_menu = 'bbb';
$sub_menu = 'bbb-q';
$sub_menu2 = 'bbb-w';
break;
case "product03_1" :
$main_menu = 'ccc';
$sub_menu = 'ccc-q';
$sub_menu2 = 'ccc-w';
break;
}
${"check_$bo_table"} = "on";
?>
<ul class="navi left_menu_list gnb-2dep">
<li>
<a href="#" class="<?=$check_product01_1?>">
<span>aaa</span>
<i class="xi-angle-down-min list"></i>
</a>
<ul class="depth3_menu gnb-3dep" style="display:none;">
<li><a href="#">aaa-1</a></li>
<li><a href="#">aaa-2</a></li>
</ul>
</li>
<li >
<a href="#" class="<?=$check_product02_1?>">
<span>bbb</span>
<i class="xi-angle-down-min list"></i>
</a>
<ul class="depth3_menu" style="display:none;">
<li><a href="#">bbb-1</a></li>
<li><a href="#">bbb-2</a></li>
</ul>
</li>
<li >
<a href="#" class="<?=$check_product03_1?>">
<span>ccc</span>
<i class="xi-angle-down-min list"></i>
</a>
<ul class="depth3_menu" style="display:none;">
<li><a href="#">ccc-1</a></li>
<li><a href="#">ccc-2</a></li>
</ul>
</li>
</ul>
top부분에 저렇게 넣어놓은 상태인데 해당 게시판 클릭시 ul li의 각각 리스트만 보이게 하고싶습니다.
어떻게 수정해야할까요?
답변 1
<ul class="navi left_menu_list gnb-2dep">
<?php if($bo_table == "product01_1") { ?>
<li>
<a href="#" class="<?=$check_product01_1?>">
<span>aaa</span>
<i class="xi-angle-down-min list"></i>
</a>
<ul class="depth3_menu gnb-3dep" style="display:none;">
<li><a href="#">aaa-1</a></li>
<li><a href="#">aaa-2</a></li>
</ul>
</li>
<?php } ?>
<?php if($bo_table == "product02_1") { ?>
<li >
<a href="#" class="<?=$check_product02_1?>">
<span>bbb</span>
<i class="xi-angle-down-min list"></i>
</a>
<ul class="depth3_menu" style="display:none;">
<li><a href="#">bbb-1</a></li>
<li><a href="#">bbb-2</a></li>
</ul>
</li>
<?php } ?>
<?php if($bo_table == "product03_1") { ?>
<li >
<a href="#" class="<?=$check_product03_1?>">
<span>ccc</span>
<i class="xi-angle-down-min list"></i>
</a>
<ul class="depth3_menu" style="display:none;">
<li><a href="#">ccc-1</a></li>
<li><a href="#">ccc-2</a></li>
</ul>
</li>
<?php } ?>
</ul>