WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Templates, Menus & Design => Topic started by: arrow345 on May 25, 2012, 10:34:31 AM

Title: WB Menu vs. Own Menu
Post by: arrow345 on May 25, 2012, 10:34:31 AM
Hi everyone,

I'm having a little issue with the menu. On my normal site, it looks like so:

www.mcoenvironmenta l.com


However, using WB, it has been showing like this:

http://mcoenvironmental.com/wb/pages/team.php


I'm using the same CSS file on both. I'm guessing it has to do with the way WB sets up its menu, but I'm not sure. Any ideas?

Thank you as always,

Arrow
Title: Re: WB Menu vs. Own Menu
Post by: Hans on May 25, 2012, 10:43:06 AM
second link: 404 error...
Hans
Title: Re: WB Menu vs. Own Menu
Post by: nibz on May 25, 2012, 11:04:05 AM
I think the correct link is: http://mcoenvironmental.com/wb/pages/about-us/team.php
Title: Re: WB Menu vs. Own Menu
Post by: marmot on May 25, 2012, 11:10:27 AM
Hi,

http://mcoenvironmental.com/wb/pages/team.php
I'm using the same CSS file on both. I'm guessing it has to do with the way WB sets up its menu, but I'm not sure. Any ideas?
I guess the link should be: http://mcoenvironmental.com/wb/pages/about-us/team.php (http://mcoenvironmental.com/wb/pages/about-us/team.php)
One Problem for sure is, that you are not loading the menĂ¼ .js file.
Firebug claims: http://mcoenvironmental.com/wb/pages/about-us/tinydropdown.js is not found.

regards
Title: Re: WB Menu vs. Own Menu
Post by: nibz on May 25, 2012, 11:10:47 AM
And i think you're trying to implement a sort of superfish menu.

You didn't implement the UL class and id.

Try replacing your showmenu2 code with the following:

Code: [Select]
show_menu2(
        $aMenu          = 1,
        $aStart         = SM2_ROOT,
        $aMaxLevel      = SM2_ALL,
        $aOptions       = SM2_ALL|SM2_PRETTY,
        $aItemOpen      = '[li] [a][menu_title]</a>',
        $aItemClose     = '</li>',
        $aMenuOpen      = '<ul id="menu" class="menu">',
        $aMenuClose     = '</ul>',
        $aTopItemOpen   = false,
        $aTopMenuOpen   = false
        );

And what marmot is saying, the problem is that you don't use <?php echo TEMPLATE_DIR; ?> so the right DIR will not be found.

You have to point to your JS file just like you pointed to your CSS file.

See docu: http://www.websitebaker2.org/en/help/designer-guide/adding-template-functions.php
Title: Re: WB Menu vs. Own Menu
Post by: arrow345 on May 25, 2012, 12:06:16 PM
Thank you for all the quick responses!

Yeah, the right link was http://mcoenvironmental.com/wb/pages/about-us/team.php
I had started tinkering with adding things to the menu after I had posted this and forgot to update the link.

Right now I'm getting a set_root error whenever I try to access the modules. Does this mean I have to reinstall the update?

Title: Re: WB Menu vs. Own Menu
Post by: arrow345 on May 26, 2012, 07:00:38 PM
Hellooo,

I had to reinstall WB, but all is well.

So I updated showmenu2 and pointed the JS file, but still no cigar.

http://mcoenvironmental.com/wb/pages/team.php

Any other suggestions?
Title: Re: WB Menu vs. Own Menu
Post by: marmot on May 27, 2012, 02:25:39 AM
Hi,

Any other suggestions?
got a lot of but maybe one of the sm2 experts will have a look at it.
My help might be a bit abstract:
First of all, Firebug again shows an error, so there is something wrong with the js stuff.
What is the task?
-It's to get sm2 to give us a source code that can be recognized by tinymenu.
How does this code has to be?
-looking at the examples of tinyscript we see something like that:
Code: [Select]
<ul class="menu" id="menu">
<li><a href="#" class="menulink">Dropdown One</a>
<ul>
<li><a href="#">Navigation Item 1</a></li>
</ul>
</li>
</ul>
What do we see?
-menu starts with
Code: [Select]
<ul class="menu" id="menu">
So let's look at your pages source code?
-there's no
Code: [Select]
<ul class="menu" id="menu">
So lets look at the call to sm2 from nibz?
Code: [Select]
$aMenuOpen      = '<ul id="menu" class="menu">',
So what do we see?
-the right code should be there
So what to do?
-find out why it's no like it's supposed to be
How?
-Thats the difficult part  :-D: Maybe check the call to sm2 twice, change Parameters and see what happens, read sm2 documentation, wait for some of the sm2 experts in the forum .....

Hope this helps anyway.

regards
Title: Re: WB Menu vs. Own Menu
Post by: arrow345 on May 27, 2012, 11:54:47 AM
Marmot,

Thank you so much. I'll be looking at the documentation...may be I'll see where the problem lies. I was very confused when the sm2 fix that was suggested didn't work.

Also, based on what you sent, there'll be another issue of the li items having different classes depending on whether they are part of a submenu, are linked to something, or are just meant to be hovered over.

Hopefully we'll figure it out soon =)
Title: Re: WB Menu vs. Own Menu
Post by: nibz on May 27, 2012, 09:40:27 PM
I would spare the work of trying to implement this type of menu,
And i would use Superfish, it's much easier.

I made an example for you:(4/6/12 URL REMOVED)
Hover over mega-menu (template is only active at the mco-test page tough!)

And when i was on it, i just cleared some inconsisties on the way you link to the images etc.
(hope you like it, and can do what you like with it)

PM-ed you a download link
Title: Re: WB Menu vs. Own Menu
Post by: nibz on May 30, 2012, 04:59:58 PM
Any succes with it?

I see you are trying to give the UL a padding, but that's not possible due to the dropdowns.
You can make a menu-wrapper div and give that some width and padding.

or you can center the menu completly by changing the .sf-menu code to
Code: [Select]
display: table;
margin: 0 auto;

hope that helps