How to Customize Menus

Hi,

 

dolphin does not have a good customization for menu bar, this may help you.

 

If you want to remove all the "submenu" items from top menu, but that they still show in the submenu pages, edit BxBaseMenu.php around line 327, and comment it.

 

$sSubMenu = $this->getAllSubMenus($iItemID);

 

that will show only navigation top menu.

 

Also, if you want to remove certain Item from the top menu, but still show in the "quick links" and other pages.

 

edit BxBaseMenu.php around line 158 and look for:


foreach( $this->aTopMenu as $iItemID => $aItem ) {
         if( $aItem['Type'] != 'top' )
              continue;

 

if you want to remove the polls item from menu, you should post after it:

 

            if( $aItem['Caption'] == '_bx_polls' )
                continue;

 

if you want to remove other item, just look for the name of the item and replace, you can post the code for each items you need to remove.

 

hope it helps you.

Quote · 28 Sep 2014

 RE:

Hi,

 

dolphin does not have a good customization for menu bar, this may help you.

 

If you want to remove all the "submenu" items from top menu, but that they still show in the submenu pages, edit BxBaseMenu.php around line 327, and comment it.

 

$sSubMenu = $this->getAllSubMenus($iItemID);

 

that will show only navigation top menu.

 Not a good idea to modify /templates/base/scripts/BxBaseMenu.php

Instead, you should override the function by modifying /templates/tmpl_someTemplate/scripts/BxTemplMenu.php

Example:

<?php

/**
 * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
 * CC-BY License - http://creativecommons.org/licenses/by/3.0/
 */

bx_import('BxBaseMenu');

/**
* @see BxBaseMenu;
*/
class BxTemplMenu extends BxBaseMenu
{
    /**
    * Class constructor;
    */
    function BxTemplMenu()
    {
        parent::BxBaseMenu();
    }
   
   
        /*
    * Generate top menu elements
    */
    function genTopItem($sText, $sLink, $sTarget, $sOnclick, $bActive, $iItemID, $isBold = false, $sPicture = '')
    {
        $sActiveStyle = ($bActive) ? ' id="tm_active"' : '';

        if (!$bActive) {
            $sOnclick = $sOnclick ? ( ' onclick="' . $sOnclick . '"' ) : '';
            $sTarget  = $sTarget  ? ( ' target="'  . $sTarget  . '"' ) : '';
        }

        $sLink = (strpos($sLink, 'http://') === false && strpos($sLink, 'https://') === false && !strlen($sOnclick)) ? $this->sSiteUrl . $sLink : $sLink;

        $sMoreIcon = getTemplateIcon('tm_sitem_down.gif');

//        $sSubMenu = $this->getAllSubMenus($iItemID);

        $sBoldStyle = ($isBold) ? 'style="font-weight:bold;"' : '';

        $sImgTabStyle = $sPictureRep = '';
        if($sText == '' && $isBold && $sPicture != '') {
            $sPicturePath = getTemplateIcon($sPicture);
            $sPictureRep = '<img src="' . $sPicturePath . '" />';
        }

        $sMainSubs = ($sSubMenu=='') ? '' : <<<EOF
    <!--[if lte IE 6]><table id="mmm"><tr><td><![endif]-->
    <ul class="sub main_elements">{$sSubMenu}</ul>
    <!--[if lte IE 6]></td></tr></table></a><![endif]-->
EOF;

        $this->sCode .= <<<EOF
<td class="top" {$sActiveStyle} {$sImgTabStyle}>
    <a href="{$sLink}" {$sOnclick} {$sTarget} class="top_link"><span class="down bx-def-padding-sec-leftright" {$sBoldStyle}>{$sPictureRep}{$sText}</span>
    <!--[if gte IE 7]><!--></a><!--<![endif]-->
    <div class="sub">{$sMainSubs}</div>
</td>
EOF;
    }
}

// Creating template navigation menu class instance
$oTopMenu = new BxTemplMenu();

 

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 29 Sep 2014

Or.... you could just do it in css

.sub.main_elements {
display:none !important;
}

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 29 Sep 2014

 

Or.... you could just do it in css

.sub.main_elements {
display:none !important;
}

 Thanks

Proud Hosted by Zarconia.net
Quote · 15 Apr 2015
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.