Page 1 of 1

Styling items under section header

Posted: Sat Dec 24, 2011 1:52 am
by jasnick
Using 1.10.2 and
{menu number_of_levels="1" template="minimal_menu.tpl"}

I have a vertical menu wih some Section Headers. I want to indent only the pages that come under the Section Headers and not the Home page and others.

I can do this easily in HTML but not sure how to do this in CMSMS.

Thanks

Re: Styling items under section header

Posted: Sat Dec 24, 2011 12:22 pm
by nervino
You could grab section headers in menu template and apply a style to them.
Example:

Code: Select all

{elseif $node->type == 'sectionheader'}
        <li class="sectionheader"><span>{$node->menutext}</span>
Try to use the class "sectionheader" which is already defined in default menu template.

Re: Styling items under section header

Posted: Sat Dec 24, 2011 10:43 pm
by jasnick
Thanks nervino

Am not too familiar with editing templates if indeed that is what I am meant to do here. I can't even see where I can open the template I am using for the menu.

I have tried in the CSS:

.nav .sectionheader {padding-left: 10px;} but that just indents the actual section header which is not what I want as the links below don't move with the sectionheader.

I tried .nav .sectionheader ul li a but that didn't work and also
.nav ul li a .sectionheader.

Thanks.

Re: Styling items under section header

Posted: Sun Dec 25, 2011 12:53 am
by Dr.CSS
Try...

.sectionheader li {margin-left: 10px}

Re: Styling items under section header

Posted: Sun Dec 25, 2011 1:03 am
by jasnick
Thanks Dr.CSS but it didn't work.

Tried .nav .sectionheader and just .sectionheader with li, li a and ul li a.

Re: Styling items under section header

Posted: Sun Dec 25, 2011 1:10 am
by Dr.CSS
It really helps to have a link to the page in question...

Re: Styling items under section header

Posted: Sun Dec 25, 2011 1:15 am
by jasnick

Re: Styling items under section header

Posted: Sun Dec 25, 2011 1:20 am
by Dr.CSS
You don't have any children under the section headers they are just section separators...

You either need to customize the menu to add a page alias class or...

Re: Styling items under section header

Posted: Sun Dec 25, 2011 1:27 am
by jasnick
Thanks ! Yes, I did read something about child classes in the Documentation for menus - will go back and see if I can understand it this time, now that I know what is required

Thanks!

Re: Styling items under section header

Posted: Sun Dec 25, 2011 1:36 am
by Dr.CSS
I would just put all the ones under the section header as children under the sectionheaders then doing what you want with CSS is easy, like I posted earlier...

Re: Styling items under section header

Posted: Sun Dec 25, 2011 1:46 am
by jasnick
So even though the section headers are not pages, I make them the parent of the individual pages? Is that what you are saying?
I don't think that is what you meant as it wouldn't work.

Or add something to the menu template? Not sure what though.

Re: Styling items under section header

Posted: Sun Dec 25, 2011 1:48 am
by Dr.CSS
Yes, that way you can target them, that's actually the idea behind section headers...

Re: Styling items under section header

Posted: Sun Dec 25, 2011 1:56 am
by jasnick
I think our posts crossed - what is it that I should be doing - I don't know php so don't know what to put in the template...

Re: Styling items under section header

Posted: Sun Dec 25, 2011 2:07 am
by Dr.CSS
In admin of site go to Content > Pages and hit the reorder pages link, move the pages under the section headers where wanted, hit submit...

Re: Styling items under section header

Posted: Sun Dec 25, 2011 2:15 am
by jasnick
Yes just noticed that and have fixed it