[phpBB Debug] PHP Warning: in file [ROOT]/ext/tas2580/seourls/event/listener.php on line 213: Undefined array key "FORUM_NAME"
REDAXO Forum • Top menu and side navigation
Seite 1 von 1

Top menu and side navigation

Verfasst: 2. Nov 2004, 17:47
von romamor
I am sorry I do not speak german; I installed the new 2.7.2 version and the CSS layout looks great!

I would like to modify the layout to add a top navigation bar like this:

Home | News | Blog | Contact

The side navigation in the left column would stay as it is now,
except it has different options, depending on which menu item is selected from the top menu.

For instance, if I select "News" in the top menu, the sidebar menu will show: Film, Music, Painting, etc.

Essentially the top menu chosses a site section, possibly with a different layout, and the side menu gets the content for a given section.

Any pointers appreciated, I am a total beginner with Redaxo.
If you post the answer in german, I will use Babelfish to translate it, thank you.

Verfasst: 19. Nov 2004, 12:44
von vebulos
Hi romamor,

if you are still looking for a solution, try this:

http://forum.redaxo.de/viewtopic.php?t=155

Just copy and paste the code into your template
(or make a new one for navigation and include it),
adjust the html-code to your needs and use menu
variables.

Should you have any questions, just post here.

regards,

Verfasst: 19. Nov 2004, 16:32
von romamor
Thank you, I somehow missed this in the forum.

Verfasst: 20. Nov 2004, 05:23
von romamor
I tried the following:

- I created a template called "02.02 hvNavigation"; the template id is 6.

- In the "Default" template I replaced the id 2 with id 6 like this where I wanted the horizontal menu:

<? include $REX[INCLUDE_PATH]."/generated/templates/6.template"; ?>
<?php echo $topmenu; ?>

- and I used the following where I wanted the vertical submenu:
<div class="MenuContainer">
<?php echo $submenu; ?>
</div>

- This got me the top menu and the submenu is displayed when I navigated in the top (for the demo that would be the products option)

I am wondering if I am doig this right; being a Redaxo and PHP beginner I am not quite sure:

- how to include the new "hvNavigation" template in the "Default"? Did I do it the right way?

- what are the "menu variables" and how do I use them?

Verfasst: 20. Nov 2004, 05:52
von romamor
I have one more question regarding the styling; I know how to do this with html/css, but I am not sure how to modify the PHP code:

- I need to show the "active" menu item both in the horizontal menu and the vertical submenu, so I need a class="current" in both menus and they need to be coordinated;

When I select "Products" in the top menu, it gets active, and the sumbenu is displayed; then when I select "Product A" in the submenu, it gets "active" while the "products" is still active in the top menu.

I also need to style differently the first and/or the last menu items so this is usually done wiht a "first" and "last" classes;

The question is, how do I generate these classes so that I can style the menus properly?

I am sure these would be worthwile changes applicable for many sites, if it was somehow possible to do it.

Verfasst: 20. Nov 2004, 13:47
von vebulos
Hi,

you did that in the absolutely right way ;)
To use your own classes just replace ALL my class or id names with yours.

for example:

Code: Alles auswählen

$topmenu .= "<li><a href=\"?article_id=".$aid."\" id=\"active_menu-nav\">".$name."</a></li>";
will be:

Code: Alles auswählen

$topmenu .= "<li><a href=\"?article_id=".$aid."\" class=\"current\">".$name."</a></li>";
and so on...

Hope this helps,

regards,