How does this work? In the menu --> add link section, there is a field for "Link Icon...
I have tried putting a Font Awesome reference in this field but it does not seem to render. How is this used?
Playing around with the drupalexp code, it seems that rendering the menu is based on the native drupal theming engine which doesn't know about link icon. Anyway, my work around
add the following function
function add_icons(&$menu_tree) {
foreach($menu_tree as &$info) {
if (isset($info['#original_link']['options']['link_icon']) && $info['#original_link']['options']['link_icon'] != '') {
$info['#localized_options']['html'] = True;
$info['#title'] = '<i class="fa fa-fw ' . $info['#original_link']['options']['link_icon'] . '"></i> ' . $info['#title'];
}
if ($info['#below'])
add_icons($info['#below']);
}
}
and change from
$menu_tree = _dexp_menu_submenu_tree_all_data($tree, $menu[1]);
$menu_tree = menu_tree_output($menu_tree);
$output = render($menu_tree);
to
$menu_tree = _dexp_menu_submenu_tree_all_data($tree, $menu[1]);
$menu_tree = menu_tree_output($menu_tree);
add_icons($menu_tree);
$output = render($menu_tree);
This is a great inspiring article.I am pretty much pleased with your good work.You put really very helpful information. Keep it up. Keep blogging. Looking to reading your next post. Ace4sure 350-701
function add_icons(&$menu_tree) { foreach($menu_tree as &$info) { if (isset($info['#original_link']['options']['link_icon']) && $info['#original_link']['options']['link_icon'] != '') { $info['#localized_options']['html'] = True; $info['#title'] = '<i class="fa fa-fw ' . $info['#original_link']['options']['link_icon'] . '"></i> ' . $info['#title']; } if ($info['#below']) add_icons($info['#below']); } }
and change from$menu_tree = _dexp_menu_submenu_tree_all_data($tree, $menu[1]); $menu_tree = menu_tree_output($menu_tree); $output = render($menu_tree);
to$menu_tree = _dexp_menu_submenu_tree_all_data($tree, $menu[1]); $menu_tree = menu_tree_output($menu_tree); add_icons($menu_tree); $output = render($menu_tree);
I would like this fix as well.
This is a great inspiring article.I am pretty much pleased with your good work.You put really very helpful information. Keep it up. Keep blogging. Looking to reading your next post. Ace4sure 350-701