Styling items under section header

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
jasnick
Power Poster
Power Poster
Posts: 695
Joined: Sat Jan 15, 2011 8:36 am

Styling items under section header

Post 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
nervino
Power Poster
Power Poster
Posts: 448
Joined: Sun Dec 28, 2008 12:15 pm

Re: Styling items under section header

Post 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.
jasnick
Power Poster
Power Poster
Posts: 695
Joined: Sat Jan 15, 2011 8:36 am

Re: Styling items under section header

Post 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.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Styling items under section header

Post by Dr.CSS »

Try...

.sectionheader li {margin-left: 10px}
jasnick
Power Poster
Power Poster
Posts: 695
Joined: Sat Jan 15, 2011 8:36 am

Re: Styling items under section header

Post by jasnick »

Thanks Dr.CSS but it didn't work.

Tried .nav .sectionheader and just .sectionheader with li, li a and ul li a.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Styling items under section header

Post by Dr.CSS »

It really helps to have a link to the page in question...
jasnick
Power Poster
Power Poster
Posts: 695
Joined: Sat Jan 15, 2011 8:36 am

Re: Styling items under section header

Post by jasnick »

User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Styling items under section header

Post 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...
jasnick
Power Poster
Power Poster
Posts: 695
Joined: Sat Jan 15, 2011 8:36 am

Re: Styling items under section header

Post 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!
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Styling items under section header

Post 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...
jasnick
Power Poster
Power Poster
Posts: 695
Joined: Sat Jan 15, 2011 8:36 am

Re: Styling items under section header

Post 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.
Last edited by jasnick on Sun Dec 25, 2011 1:52 am, edited 1 time in total.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Styling items under section header

Post by Dr.CSS »

Yes, that way you can target them, that's actually the idea behind section headers...
jasnick
Power Poster
Power Poster
Posts: 695
Joined: Sat Jan 15, 2011 8:36 am

Re: Styling items under section header

Post 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...
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Styling items under section header

Post 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...
jasnick
Power Poster
Power Poster
Posts: 695
Joined: Sat Jan 15, 2011 8:36 am

Re: Styling items under section header

Post by jasnick »

Yes just noticed that and have fixed it
Post Reply

Return to “Layout and Design (CSS & HTML)”