GetSimple Support Forum

Full Version: Remove title attribute
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

how can I remove the title attribute in the navigation bar?

Thank you in advance. Smile

Sincerely,
Mark
You have to replace get_navigation by a modified function.
Here's a way:

1. Create a component e.g. my-navigation with this content:
Code:
<?php
    global $pagesArray;
    $menu = '';
    $currentpage = strval(return_page_slug());
    $pagesSorted = subval_sort($pagesArray,'menuOrder');
    if (count($pagesSorted) != 0) {
        foreach ($pagesSorted as $page) {
            $sel = ''; $classes = '';
            $url_nav = $page['url'];
            
            if ($page['menuStatus'] == 'Y') {
                if ("$currentpage" == "$url_nav") { $classes = "current active ". $page['parent'] ." ". $url_nav; } else { $classes = trim($page['parent'] ." ". $url_nav); }
                if ($page['menu'] == '') { $page['menu'] = $page['title']; }
                if ($page['title'] == '') { $page['title'] = $page['menu']; }
                $menu .= '<li class="'. $classes .'"><a href="'. find_url($page['url'],$page['parent']) . '">'.strip_decode($page['menu']).'</a></li>'."\n";
            }
        }
        
    }
    
    echo exec_filter('menuitems',$menu);
?>

2. Edit your template and replace
Code:
get_navigation(return_page_slug());
by
Code:
get_component('my-navigation');
or js

Code:
$('*[title]').removeAttr('title');
Thank you very much! It works perfectly Smile
(2013-10-15, 01:39:43)shawn_a Wrote: [ -> ]or js

Code:
$('*[title]').removeAttr('title');

Should this also work with an i18n drop menu? I'm trying to remove the title so it doesn't cover up my first drop menu item. I added your line of js in the template surrounded by script tags. I think I am missing something here....