I have file "header.html" in partial folder, here my code
<ul class="sf-menu" id="mainMenu">
{{ shoesmart:showMenu group="header" indent="tab"}}
<li><a href="{{ url }}" class="{{ class }}">{{ name }}</a>
{{ if children }}
<ul>
{{ children }}
<li><a href="{{ url }}">{{ name }}</a></li>
{{ /children }}
</ul>
{{ endif }}
</li>
{{/shoesmart:showMenu}}
</ul>
but when I refresh in browser, just show main menu, its mean that the submenu didn't show. Should I change my code ? or I also add new table for submenu in my database?
From Comments:
and I have file "shoesmart.php" in plugins folder:
function showMenu() { $return = ''; $menu_list = $this->db->select('*,CONCAT(pua.type,"/",pua.keyword) as path',false) ->from('menu mn') ->join('product_url_alias pua','mn.url_alias_id=pua.url_alias_id','LEFT') ->where('status',1) ->get() ->result_array(); foreach ($menu_list as $result) { $return[] = array( 'name' => $result['name'], 'url' => BASE_URL.'home/'.$result['path'] ); } return $return; }
and my table name in database is "default_menu" that have structure:
menu_id url_alias_id name status parent_id 1 868 Men 1 0 2 869 woman 1 0