Building a menu with images and javascript

Do something cool with CMS? Show us ...
This board is for 'Answers', and the discussion of answers... Not for questions.
wmisk
Forum Members
Forum Members
Posts: 39
Joined: Tue Aug 02, 2011 5:00 am

Re: Building a menu with images and javascript

Post by wmisk »

Using

Code: Select all

{menu template="Horizontal Menu" start_element="1" show_root_siblings="1" number_of_levels="1"}
takes away all child menus, changing the number of levels to 3 brings them back, but still have the remaining links in white below the header.

Here's a rundown of my hierarchy:
Self Reliance -> has children
Water and Food -> has children
Warmth and Shelter -> has children
Financial Stability -> has children
Emergency Kits -> has children
Health and First Aid -> has children
Privacy Policy
Legal
About Us
Contact Us
Blog
Home

I want the first six pages with children to appear as image links in the header, and have a drop down menu for the child links.
The next six links appear in a secondary menu at the bottom under the copyright. I was able to set up the secondary menu using excludeprefix (and omitted the first six pages) since none of those pages have child links. What I'm looking for is a menu parameter or code to change in the menu template to limit the number of links in that top menu to the first 6, and still allow their child links. Hopefully this makes sense.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12709
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: Building a menu with images and javascript

Post by Dr.CSS »

Set the ones you don't want in the top menu to not show in menu then in footer or wherever else you want them use items='page-alias,page_alias'....
wmisk
Forum Members
Forum Members
Posts: 39
Joined: Tue Aug 02, 2011 5:00 am

Re: Building a menu with images and javascript [Solved]

Post by wmisk »

Thank you, that solution works-no more extra whitespace at the top, and the submenus are still intact-Thanks again!!
wmisk
Forum Members
Forum Members
Posts: 39
Joined: Tue Aug 02, 2011 5:00 am

Re: Building a menu with images and javascript [Solved]

Post by wmisk »

FYI, this code looks great in Firefox, but in IE 8 my submenus came up as broken images. Changing the code in the menu template to the following fixed it:

Code: Select all

{if $node->image == true}<span class="img"><img src="{$node->image}" alt="{$node->menutext}" border="0" /></span>{else}{$node->menutext}{/if}
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12709
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: Building a menu with images and javascript

Post by Dr.CSS »

I think the code changed in the 1.10.* series, thanks for the new code...
Post Reply

Return to “Tips and Tricks”