Not sure this is a bug, but....

I want to display the sub menu on the index page, but only for guests.  Logged in members wont get a sub menu.

 

To test, I modified BxBaseMenu.php   (added code in red)

 

        //--- Submenu Menu ---//
        $sSubMenu = '';
       if(!defined('BX_INDEX_PAGE') && !defined('BX_JOIN_PAGE'))
            $sSubMenu = $this->genSubMenus();

 if(!isMember() && (defined('BX_INDEX_PAGE'))) $sSubMenu = $this->genSubMenus();

        $sResult = $oSysTemplate->parseHtmlByName('navigation_menu.html', array(
            'main_menu' => $sMainMenu,
            'sub_menu' => $sSubMenu

 

It works, but only when the url is Mysite.com/index.php

 

When the url is simply Mysite.com, the sub menu container is present, but the sub menu is not generated.  Not a big deal because I can use a url rewrite to always add index.php  The only caveat of a Rewrite, is that you need to use a 301 redirect to keep search engines happy. It would be nice to be able to avoid all this.

 

I just wondered if I was missing anything.  I don't want site visitors to NOT see the submenu, if their entry point is mysite.com/

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 22 Oct 2015

Looks to me its because of the lines above....Doesn't appear to be a bug but rather how the code is written to work. Maybe try removing these lines and see if it works. May be conflicting with the line you added.

 

if(!defined('BX_INDEX_PAGE') && !defined('BX_JOIN_PAGE'))
$sSubMenu = $this->genSubMenus();
Jeremy
Quote · 22 Oct 2015

 

Looks to me its because of the lines above..

 I don't think you understand the issue. There may not be a coding fix.  Simply put, PHP doesn't know apache is delivering index.php @ url mysite.com, so the constant 'BX_INDEX_PAGE' is not defined in that case.

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 23 Oct 2015

Try this.

Edit BxBaseMenu.php

Look for this at about line 240


    /*
    * Generate sub menu elements
    */
    function genSubMenus()
    {
        foreach( $this->aTopMenu as $iTItemID => $aTItem ) {
            if( $aTItem['Type'] != 'top' && $aTItem['Type'] !='system')
                continue;

            if( !$this->checkToShow( $aTItem ) )
                continue;


Add this under it.

            if($this->aMenuInfo['currentTop'] == -1) $this->aMenuInfo['currentTop'] = 5;


https://www.deanbassett.com
Quote · 23 Oct 2015

 RE


Add this under it.

            if($this->aMenuInfo['currentTop'] == -1) $this->aMenuInfo['currentTop'] = 5;


 Perfect!  Thanks Deano   (I added the modified function to BxTemplMenu.php)

 

This is why you write code for a living, and I don't.  In another 5 years or so, I'll understand why that works.

 

That line should probably be added to the distribution, because even without what I added, anyone that wants to display the sub menu on the index page will have the same problem.

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 23 Oct 2015

Things are looking up.  Got a sub menu on the index page for guests, and now I even have a blue Facebook button. What more could a person ask for?

 

SubMenuIndex.png · 541.8K · 345 views
My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 23 Oct 2015

 

 

Looks to me its because of the lines above..

 I don't think you understand the issue. There may not be a coding fix.  Simply put, PHP doesn't know apache is delivering index.php @ url mysite.com, so the constant 'BX_INDEX_PAGE' is not defined in that case.

 Don't yell at me! lol

Jeremy
Quote · 23 Oct 2015

 

Don't yell at me! lol

 Where was I yelling?

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 23 Oct 2015

 

 

Don't yell at me! lol

 Where was I yelling?

 Relax junior...notice the lol on the end of my statement? :-)

Jeremy
Quote · 23 Oct 2015

 

 Relax junior...notice the lol on the end of my statement? :-)

 <lol>

OH.... 'lol'  .... I never really got into all that cool internet lingo, so I really don't pay much attention to it.

</lol>

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 23 Oct 2015

 

 

 Relax junior...notice the lol on the end of my statement? :-)

 <lol>

OH.... 'lol'  .... I never really got into all that cool internet lingo, so I really don't pay much attention to it.

</lol>

 It's all good brother! Enjoy your evening.

Jeremy
Quote · 23 Oct 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.