Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • jimesten Friend
    #133085

    How can I disable the menu descriptions, so instead of getting….


    Home
    Welcome to the frontpage

    I just get ….

    Home

    on the top menu links.

    Thanks!

    Sherlock Friend
    #269264

    Hi
    You go to Menus-> Main menu, then choose Home menu to edit
    You will see a paramater is Page title
    2753
    you can change as you want

    jimesten Friend
    #269362

    I dont think you are understanding.

    I know that you can change the page titles, and that is how they display on the menu. I want to remove them entirely.

    What I have now

    what i want to get rid of

    What I want…

    Menalto Friend
    #269396

    IF you open the template folder/ja_menus/Base.class.php and find line 243 to 250 and remove it:
    [PHP] //Add page title to item
    if ($level == 0 && $this->getParam(‘menu_title’)) {
    if ($this->getPageTitle($iParams)) {
    $txt .= ‘<span class=”menu-desc”>’. $this->getPageTitle($iParams).'</span>’;
    } else {
    $txt .= ‘<span class=”menu-desc”>’. $tmp->name.'</span>’;
    }
    }[/PHP]

    It should work i think , just remember to backup the file before you do it.

    pgrandmontagne Friend
    #269491

    Would it be possible to use the “title alias” parameter being shown instead of the “page title” as described above?

    Sherlock Friend
    #269610

    Hi pgrandmontagne !
    to show alias on description span , you can do it following way below :
    open base.class.php file in templates/ja_olivine/ja_menus folder , find following code section at about line 244 :


    if ($level == 0 && $this->getParam('menu_title')) {
    if ($this->getPageTitle($iParams)) {
    $txt .= '<span class="menu-desc">'. $this->getPageTitle($iParams).'</span>';
    } else {
    $txt .= '<span class="menu-desc">'. $tmp->name.'</span>';
    }
    }

    change to :


    if ($level == 0 && $this->getParam('menu_title')) {

    $txt .= '<span class="menu-desc">'. $tmp->alias.'</span>';

    }

    pgrandmontagne Friend
    #269817

    <em>@hainn84 78711 wrote:</em><blockquote>Hi pgrandmontagne !
    to show alias on description span , you can do it following way below :

    </blockquote>

    Hello hainn84,
    I’ve done what you said, description span is empty now.
    Maybe you can check the code again, please?

    jernejc Friend
    #269991

    The title alias would be a great solution for Joomla 1.0 as the page title parameter isn’t so common. Unfortunately the code fix above didn’t work for me either.

    jernejc Friend
    #269994

    For the title alias to be written out as the menu item description you need to add these lines:


    //jernej
    $sql="select title_alias from jos_content where id=$tmp->componentid";
    $db=mysql_query($sql);
    $x=mysql_fetch_assoc($db);
    $title_alias=$x["title_alias"];

    in ja_olivine/ja_menus/Base.class.php ( line 218 ) right after:


    $data = null;
    $tmp = $item;

    And then replace $tmp->name here ( line 243 or 249ish after you add the code above ):


    if ($level == 0 && $this->getParam('menu_title')) {
    if ($this->getPageTitle($iParams)) {
    $txt .= '<span class="menu-desc">'. $this->getPageTitle($iParams).'</span>';
    } else {
    $txt .= '<span class="menu-desc">'. $tmp->name.'</span>';
    }
    }

    with: $title_alias

    So it looks like this:


    if ($level == 0 && $this->getParam('menu_title')) {
    if ($this->getPageTitle($iParams)) {
    $txt .= '<span class="menu-desc">'. $this->getPageTitle($iParams).'</span>';
    } else {
    $txt .= '<span class="menu-desc">'. $title_alias.'</span>';
    }
    }

    The problem was that there is no “title_alias” field in the “jos_menu” table. So we have to get the value from the “jos_content” table.

    This only solves the problem while you have ordinary content links. On the other hand though, most custom components have a parameter box on the right when you link them into a certain menu.

    So if you want to set the page title parameter in that case, you just write into that box: “header=Your page title here” ( without the ” ), and that’s about it.

    PS: that sql query above is a bit long, so if anyone knows an easier way, please share.. 🙂

    Sherlock Friend
    #270040

    thanks jernejc !
    your post is very helpful !

    trinhnfs Friend
    #271111

    Hi

    Could you show me the easy way to disable the menu descriptions. I has done but nothing changed.

    Thanks and Best Regards

    Trinh

    Nathan L Zabaldo Friend
    #271248

    Another alternative:

    In Base.class.php around line 133 in the function genMenuItem:

    Below the code:


    $data = null;
    $tmp = $item;

    Add the Code:

    $sql = 'select alias from jos_menu where id = ' . $tmp->id;
    $db = mysql_query($sql);
    $x = mysql_fetch_assoc($db);
    $title_alias = $x["alias"];

    Then in the same genMenuItem function around line 165:

    Change the //Add page title to item code to:

    //Add page title to item
    if ($level == 0 && $this->getParam('menu_title')) {
    if ($this->getPageTitle($iParams)) {
    $txt .= '<span class="menu-desc">'. $title_alias.'</span>';
    } else {
    $txt .= '<span class="menu-desc">'. $title_alias.'</span>';
    }
    }

    If you want to get rid of the alias and menu description code altogether just comment out the //Add page title to item block.

    pgrandmontagne Friend
    #271870

    Hi,
    I’ve made changes as described in this post.
    Seems I’ve got some sql problems:

    <blockquote>Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/www/root/main/praxis/joomla1/templates/ja_olivine/ja_menus/Base.class.php on line 220</blockquote>

    Anybody can help me?
    Thanks a lot!

    jernejc Friend
    #271886

    Did you enter the title alias in your Joomla backend? The problem might occur because that field is empty.

    pgrandmontagne Friend
    #271893

    title alias is not empty and i’ve made no code-changes but yours :confused:

Viewing 15 posts - 1 through 15 (of 16 total)

This topic contains 16 replies, has 7 voices, and was last updated by  jernejc 16 years, 1 month ago.

We moved to new unified forum. Please post all new support queries in our New Forum