Posted by Develcode on December 13, 2011 at 4:22am
kali ini sesuai permintaan seseorang di facebook akan ku jelaskan bagaimana me markup superfish menu anda
pertama silahkan tempatkan Xhtml region superfish anda di halaman anda sesuai selera atau jika belum punya superfish silahkan download sendiri di jquery.com
kedua buat preprocess di templates.php anda
ikuti code ini
<?php
/**
* Return a multidimensional array of links for a navigation menu.
*
* @param $menu_name
* The name of the menu.
* @param $level
* Optional, the depth of the menu to be returned.
* @return
* An array of links of the specified menu and level.
*/
function Thememu_navigation_links($menu_name, $level = 0) {
// Don't even bother querying the menu table if no menu is specified.
if (empty($menu_name)) {
return array();
}
// Get the menu hierarchy for the current page.
$tree_page = menu_tree_page_data($menu_name);
// Also get the full menu hierarchy.
$tree_all = menu_tree_all_data($menu_name);
// Go down the active trail until the right level is reached.
while ($level-- > 0 && $tree_page) {
// Loop through the current level's items until we find one that is in trail.
while ($item = array_shift($tree_page)) {
if ($item['link']['in_active_trail']) {
// If the item is in the active trail, we continue in the subtree.
$tree_page = empty($item['below']) ? array() : $item['below'];
break;
}
}
}
return Thememu_navigation_links_level($tree_page, $tree_all);
}
/**
* Helper function for especial_navigation_links to recursively create an array of links.
* (Both trees are required in order to include every menu item and active trail info.)
*/
function Thememul_navigation_links_level($tree_page, $tree_all) {
$links = array();
foreach ($tree_all as $key => $item) {
$item_page = $tree_page[$key];
$item_all = $tree_all[$key];
if (!$item_all['link']['hidden']) {
$class = '';
$l = $item_all['link']['localized_options'];
$l['href'] = $item_all['link']['href'];
$l['title'] = $item_all['link']['title'];
if ($item_page['link']['in_active_trail']) {
$class = ' active-trail';
}
if ($item_all['below']) {
$l['children'] = Thememu_navigation_links_level($item_page['below'], $item_all['below']);
}
// Keyed with the unique mlid to generate classes in theme_links().
$links['menu-'. $item_all['link']['mlid'] . $class] = $l;
}
}
return $links;
}
?>penjelasan nya sudah ada di commentar di situ, aku males nulis ni.
langkah ketiga
masukan ini dalam menu trail yang telah di buat page.tpl.php
<?php
<!-- Superfish Menu //-->
<div class="top_menu">
<ul class="sf-menu">
<li class="current"><a href=<?php if (isset($primary_links)) { ?>
<?php print theme('links', thememu_primary_links(), array('class' => 'links', 'id' => 'primary-links')) ?>
<?php } ?>
<?php if (count(especial_navigation_links('menu-tertiary-links'))) { ?>
<?php print theme('links', thememu_navigation_links('menu-tertiary-links'), array('class' => 'links', 'id' => 'tertiary-links')) ?>
<?php } ?>
</div>
<!--// End Superfish Menu -->
?> <?php print theme('links', thememu_navigation_links('menu-tertiary-links'), array('class' => 'links', 'id' => 'tertiary-links')) ?>bagian ini mengidentifikasi expand menu tree yang telah anda buat
clear cache kamu, dan lihat apa yang terjadi