WebsiteBaker Support (2.8.x) > Templates, Menus & Design

making different menu layout for different pages

(1/1)

Availor:
I'm trying to play around with some ideas I have. The idea is to create different classes for different pages.
For example - first page will be blue, about pages will be green and downloads page will be yellow.

Here is my try with the code, which works partially...


--- Code: ---<?php show_menu(1, 1, 1, true, &#39;<li>[a][menu_title][/a]</li>&#39;, &#39;&#39;, &#39;&#39;, &#39;&#39;, &#39;&#39;, &#39;
    [if(PAGE_ID == 1) { class="active1" }]
    [elseif(PAGE_ID == 2) { class="active2"}]
    [else { class="active" } ]
    
    &#39;); ?>
--- End code ---

I guess I'm doing something wrong there but you get the idea...

Bramus:
i think you can also do it by making different style sheets for the page_ids and then in the head section where you call the stylesheet make an if/else statement that checks for the page_id and then takes the style sheet that belongs to that page_id.

In that case you first make the site working with 1 stylesheet, then just edit the colours you want and save it on a different name like page_id2.css or contact.css or something like that.

Availor:
That's also an idea... have to try that out  although it would be nice to let the user edit it from the backend

Navigation

[0] Message Index

Go to full version