Beiträge: 5
Registriert: 24. Aug 2004, 22:11

Top menu and side navigation

2. Nov 2004, 17:47

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.

Beiträge: 13
Registriert: 18. Nov 2004, 11:59

19. Nov 2004, 12:44

Hi romamor,

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

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

Should you have any questions, just post here.

-= God bless Redaxo =-

Beiträge: 5
Registriert: 24. Aug 2004, 22:11

19. Nov 2004, 16:32

Thank you, I somehow missed this in the forum.

Beiträge: 5
Registriert: 24. Aug 2004, 22:11

20. Nov 2004, 05:23

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; ?>

- 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?
Zuletzt geändert von romamor am 20. Nov 2004, 06:08, insgesamt 2-mal geändert.

Beiträge: 5
Registriert: 24. Aug 2004, 22:11

20. Nov 2004, 05:52

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.

Beiträge: 13
Registriert: 18. Nov 2004, 11:59

20. Nov 2004, 13:47


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,

-= God bless Redaxo =-

Zurück zu „Allgemeines [R2]“

Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 2 Gäste