<div class="cnb_n_list" style="display:none;"> <style> .cnb_n_list .cTab li ul{display:none;} .cnb_n_list .cTab li.on ul{display:block;} </style> {@ $cate_list = array(); $current_key = null; } <!--@foreach($category_list as $key=>$val)--> <!--@if(!$val->depth)--> {@ $cate_list[$key] = $val; $cate_list[$key]->children = array(); $current_key = $key; } <!--@elseif($current_key)--> {@ $cate_list[$current_key]->children[] = $val } <!--@end--> <!--@end--> <ul class="cTab clear"> <li class="home<!--@if(!$category)--> on<!--@end-->"><a href="{getUrl('category','','page','','document_srl','')}" title="{$lang->document_count} {number_format($total_count)}">{$lang->total}<small cond="$mi->cnb_count">({number_format($total_count)})</small></a></li> <li loop="$cate_list=>$key,$val" class="on"|cond="$category==$val->category_srl"> <a href="{getUrl(category,$val->category_srl,'document_srl','','page','')}" style="color:{$val->color}"|cond="$val->color!='transparent'">{$val->title}<small cond="$mi->cnb_count">({$val->document_count})</small></a> <ul cond="count($val->children)"> <li loop="$val->children=>$idx,$item" class="on"|cond="$category==$item->category_srl"><a href="{getUrl(category,$item->category_srl,'document_srl','','page','')}" style="color:{$item->color}"|cond="$item->color!='transparent'">{$item->title}</a></li> </ul> </li> </ul> </div> <div class="category-box" cond="$category_list && !$search_keyword" style="display:none;"> <div class="cat-root"> <!-- <a href="{getUrl('','mid',$mid,'category','','page','','document_srl','')}" class="on"|cond="!$category">전체 {$total_count} </a>--> <!--@foreach($category_list as $val)--> <a href="{getUrl('category',$val->category_srl,'page','','document_srl','')}" class="on"|cond="$val->selected" cond="$val->depth==0">{$val->title} {$count}{$val->category_srl} / 깊이{$val->depth}/ 부모:{$val->parent_srl}</a> <!--@endforeach--> </div> <div class="cat-sub" style="display:flex;"> <!-- $val->parent_srl==$category cond="$val->category_srl == $val->parent_srl" --> <!--@foreach($category_list as $val)--> <div style="padding: 1rem;display:flex;"><div style="flex:1;"><pre>{implode(',',$val->childs)}</pre></div></div> <a href="{getUrl('category',$val->category_srl,'page','','document_srl','')}" class="on"|cond="$val->selected" cond="$val->depth!==0">#{$val->title} {$count}{$val->category_srl} / 깊이{$val->depth} / 부모:{$val->parent_srl}</a> <!--@endforeach--> </div> </div> <div class="cate"> {@ $_cdepth = 0;} <block loop="$category_list => $key, $val"> <block cond="$_cdepth > $val->depth">{@ $_cdepth = $val->depth}</block> <block cond="$val->expand"><a href="{getUrl('category',$val->category_srl, 'document_srl', '')}">{$val->text}</a> > </block> <block cond="$val->category_srl==$oDocument->get('category_srl')"><a href="{getUrl('category',$val->category_srl, 'document_srl', '')}">{$val->text}</a></block> <block cond="$val->child_count">{@$_cdepth++}</block> </block> </div>
관련글
https://opentutorials.org/module/3774/24591