Menu question

ivanisevic82

#14
Quote from: Ruud on October 08, 2008, 10:13:07 PM
Two things.

1. I like the script you use for the top menu. It looks great.

2. You won't be able to keep the red top-menu button when you ar in a subpage.

The menu is not built using show_menu2, but it is hardcoded (i assume).
When it was dynamically built you would see classes like menu-parent.
That is something you can use to keep the parent highlighted.
Here in one of my sites I am using that. Clicking the submenu on the right will keep the top menu highlighted.
In your case: For the browser (who needs to do the CSS interpretation) there is no relation between the top menu and the submenu on the side.

You could try to build the top menu with SM2, but that is pretty difficult.

SM2 has an option to add numbers to the classes it generates. (SM2_NUMCLASS)
Using that you could replace your current 8 classes for the menu and make it dynamically.
Again, this will become pretty complicated and will keep you busy for some time.

Ruud


Ok, I try to repeat to see if I understand.
As I suspected there is no way to keep red my top menu, untill it is built without SM2.

Before to think at the solution of make dynamic my top menu, I ask to you: when you say "That is something you can use to keep the parent highlighted. Here in one of my sites I am using that"
You want to say that me too can use this "something, that I don't understand what is?
(sorry but my english is very poor).

Thinking about the top menu dynamic (with SM2)...this is the situation:

I learnt yesterday the possibility to use the NUMCLASS, and with this option I surely can create two different menu, placed in different field of the site (horizontal and vertical) but with a "parent relationship".

So, my situation is a little bit more complicated cause the script you liked :D

Now I will post part of the code so you can maybe understand.
It's NOT complete, only same parts to make you understand.

In the php part I made a menu in this way (this is the example of the page "Per le imprese", in the middle of the top menu):

<li id="Imprese"><a href="http://ivanisevic82.netsons.org/pages/per-le-imprese.php"><span></span>Per le Imprese</a></li>

and in the CSS part this:


#Imprese a{width: 112px;left: 489px;background-position: -489px 0}
#Imprese a.active{background-position: -489px -35px}
#Imprese span{width: 112px;background-position: -489px -35px}


In praticse the element that give me the possibility to use the script è che "span", that isn't there when you make a "normal menu".

I ask: the showmenu2 create in a dynamic way something similar? If I want to give a different css code for every one of the 8 part of the menu (Chi siamo; Recupero Crediti, Informazioni; etc...) can I?
Or with SM2 you can only use the css to ALL the menu, and not to single part of it?

So...I'm thinking, but it's only a stupid idea maybe...could I create the (horizontal top) menu with SM2 and to add the part of code (span) usefull to make the script building a separate index of the 8 part of the menu.

What do you think about this possibility?

Thank you, bye!

PS Where are you from? Beacouse...if you speak Italian could be very more simple to me understand! :D

PPS ***Important*** Another possibility could be build 8 different template, where all the menu is made with showmenu2 and the first page of every 8 template, is one of the 8 in the top menu.
And I keep it ever "red" by a script that I could place at the start of every page.
What do you think about it?

Ruud

Two things.

1. I like the script you use for the top menu. It looks great.

2. You won't be able to keep the red top-menu button when you ar in a subpage.

The menu is not built using show_menu2, but it is hardcoded (i assume).
When it was dynamically built you would see classes like menu-parent.
That is something you can use to keep the parent highlighted.
Here in one of my sites I am using that. Clicking the submenu on the right will keep the top menu highlighted.
In your case: For the browser (who needs to do the CSS interpretation) there is no relation between the top menu and the submenu on the side.

You could try to build the top menu with SM2, but that is pretty difficult.

SM2 has an option to add numbers to the classes it generates. (SM2_NUMCLASS)
Using that you could replace your current 8 classes for the menu and make it dynamically.
Again, this will become pretty complicated and will keep you busy for some time.

Ruud
[url=https://dev4me.com/modules-snippets/]Dev4me - WebsiteBaker modules[/url] - [url=https://wbhelp.org/]WBhelp.org[/url]

ivanisevic82

#12
Ok, maybe I understand, now i will work to do it.

Thank you very much!

So, the site is not ready and I have to correct all that part...and for the moment it is only a try (I will move it on the official host space after I finish), but I link it becouse I need another help from you!

http://ivanisevic82.netsons.org

All the pages about I spoke in this topic are tha pages that i have a a vertical menu on the left of the web site.

So, all this group of page are Sub page of 8 main page, that are placed in a horizontal menu, on the top of the website.

I'd like that every button of this horizontal main menu be "active" (red) not only when I'm in the page of the button, but when I'm in the sub page too.

In praticse I want that the button "red" show in which area of the web site I am.

For the moment I used a script for every first page of the main menu, to make it "red".
I'd like to find a better solution, that cover all the page in the site.

Ruud

QuoteMaybe all my confusione is becouse I don't understand what I exactly have to do when you say: "hen create the link in B".

When you are in the backend, and edit the menulink page (B), you need to enter the url or internal link where it should go to.
That was what I meant with "create the link".

Anyway?
Can we have a look at the site when its online?

Bye,

Ruud

[url=https://dev4me.com/modules-snippets/]Dev4me - WebsiteBaker modules[/url] - [url=https://wbhelp.org/]WBhelp.org[/url]

ivanisevic82

#10
Quote from: Ruud on October 08, 2008, 07:31:27 PM
What erpe says is the only solution to skip page B.
Create a menulink page for B and link it to C1.
It is a bit tricky to make. You need to create B first, don't fill parameters yet.
Move C1 to be a child of B. Then create the link in B.


Thank you.
But, how can I create the link in B?
Consider that B has to be child of A.
If I understad I have to create B and don't touch it.
After, I have to create C1 and make it child of B.

In this way I have:
- a menu A without child B;
- a menu B mather of C1;
- a menu C1 child of B.

Maybe all my confusione is becouse I don't understand what I exactly have to do when you say: "hen create the link in B".

Thank you again, bye!


PS  I resolved the problem about Showmenu2, i finally understand the documentation!

Bye!

Ruud

What erpe says is the only solution to skip page B.
Create a menulink page for B and link it to C1.
It is a bit tricky to make. You need to create B first, don't fill parameters yet.
Move C1 to be a child of B. Then create the link in B.

Show_menu2:

If you want B to be visible when on C1, use the second parameter SM2_ROOT+1
If you want B to disappear, use SM2_CURR as a second parameter.

Did you have had a look at http://code.jellycan.com/sm2test/ already?
The page is filled with examples for show_menu2.

Ruud
[url=https://dev4me.com/modules-snippets/]Dev4me - WebsiteBaker modules[/url] - [url=https://wbhelp.org/]WBhelp.org[/url]

ivanisevic82

#8
But in this way "B" (and all the sub pages "C", "D", etc...) will be out from showmenu2 module?

And After: when I'm in C1 i want to see even C2 and C3 in the menu...how I could see it if C1 menu is no mother of them?

erpe0812

So why you dont create B as a Menu Link page, poiting direct to C1?

Thats is all.

rgds

erpe

ivanisevic82

Thanks for your support.

I try to do a question more simple, so I can make the situation clearer for you.

Cosider a menu like this

A
  B
    C1
    C2
    C3

When I am in "A" I want to see in the menu the page "B". No problem for this.
But when I click on "B" (in the menu) I'd like to go directly to "C1" page.

In praticse "B" page is usefull only to saw it in the menu when I am in "A" page, but there is nothing inside B!

Maybe you are thnking "why don't you put C1 directly after A (A>C1-C2-C3).
The cause is this: C1-C2-C3 are parts of a sub-group, called "B".
If I don't use the page B, I cannot see the name con the sub-group "B" in the menu, when I am in "A".

Can you help me to resolve this problem?

Thank you!

Ruud

Did you try:

show_menu2(0, SM2_CURR, SM2_CURR+1);

If that isn't it, please try to explain what elements you want to see when you are in D1

Ruud
[url=https://dev4me.com/modules-snippets/]Dev4me - WebsiteBaker modules[/url] - [url=https://wbhelp.org/]WBhelp.org[/url]

erpe0812

Hello

no sorry, I cannot solve this problem for you.
Maybe a coder or one who is fit with sm2 can help you with this.

I think a link to your page will be helpful.

rgds

erpe

ivanisevic82

I saw it, but is very difficult to me understand something, I used google translate but it didn't help me so much.

So, for the moment I found a solution, adding a code in my css:

#navigation li.menu-current a{
color: #E41111;
text-decoration: underline;
padding: 0.4em 0.2em 0.3em 1.8em;
background-image: url(/media/Lente.gif);
background-repeat: no-repeat;
}


But this doesn't resolve all my problem, but only the "soon" page.

I explain to you my situation, maybe we can try a better solution.

My menu is like this:

A1
   B1
   B2
   B3
A2
   B4
   B5
   B6
   B7
   B8
A3
   B9
   B10
   B11
   B12
A4
   B13
        C1
        C2
        C3
            D1
            D2
        C4
   B14
        C5
        C6
   B15
   B16
A5
   B17
   B18
   B19
A6

The "A" menu are placed in a horizontal menu in the top of the page.
All the other page (B, C, D) are son (for exaple, B is son of A and C is son of B).

So, for the part A1; A2; A4; A5; there is no problem: I used this cose, anche I see in the site ONLY the son adjective to the relative mother (A1; A2; etc...)

show_menu2(0, SM2_ROOT+1, SM2_CURR+1);

The problem is for the section "A4".
Becouse if I use the code I posted before, I see for the "sub-son" page (C and D) all the page "mother" (if I am in "D" I see in the menu "B, C, D", but I want to see ONLY D!

So, I tried to use this different code:
show_menu2(0, SM2_CURR+1, SM2_CURR+1);

But with this, if I am in "D" level, I don't see the other D, but I could see only the son of D.

For the moment I resolved the problem writing in the menu navigation fild ad a normal link, but in this way not all the page are added using showmenu2, and I have a "mixed" menu!

Can you help me to resolve this problem?

Thank you, bye!

erpe0812

#2
Hello,

we had a thread about that shortly.
Please try the search.
I will also try to find it.

rgds

erpe

Found it: https://forum.websitebaker.org/index.php/topic,11260.0.html
It is in german but hope it helps. It is exact for you are asking for.

ivanisevic82

Hi!
Sorry for my english, I hope you understand me.
I have a problem using showmenu2.

With this module I created a menu for my web site.

So, working on the css file of my template, I built a menu that change image when I roll with the mouse over the page.

I'd like that when I am in a page, the corresponding part of menu be "active".
Not only when the mouse in hover it, but for all the time I stay in that page.

I hope you understand!

Thank you for help, bye!