• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Insert ID for horizontal drop line menu
PostPosted: Wed Jul 07, 2010 3:37 am 
Offline
Forum Members
Forum Members

Joined: Fri Jun 11, 2010 7:55 am
Posts: 19
Dear masters!

I want to have a horizontal drop line menu and I want align it base on parent menu, here is structure:



So, I'd like insert ID for
    when menu has submenu to align it by css, can it possible?.

    Thank masters!


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Insert ID for horizontal drop line menu
PostPosted: Wed Jul 07, 2010 9:14 am 
Offline
Administrator
Administrator
User avatar

Joined: Thu Mar 09, 2006 5:32 am
Posts: 12663
Location: Arizona
First off ID or class can't use numbers, you will need a letter in front of it...

You will need to import a menu template and customize it, first thing I would do is put numbers after or before every
    call in it to find which one to target then you can use the {counter} function to count the steps/amount of times it's cycled thru the

_________________
Check ver. CMSMS, PHP, server OS, in System Information page.
Default content http://multiintech.com/defaultcontent/
People are Wonderful
Business is Great
Life is Terrific
Ever wonder what happened to the Album module? Well it is alive and well.
http://album.multiintech.com/
Image


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Insert ID for horizontal drop line menu
PostPosted: Wed Jul 07, 2010 10:49 am 
Offline
Power Poster
Power Poster
User avatar

Joined: Thu Jan 26, 2006 11:46 am
Posts: 693
Yup, IDs cannot start with a number... they should also be unique on a page. So, you need to use classes instead of IDs or use two "prefixes", one for the UL submenus, the other for the actual menu items.. example below, based on minimal_menu.tpl, uses the latter.

Code:
{*
entire menu is <ul id="menu">
nested submenus are <ul id="menu_N"> where N equals hierarchy position of parent
menu items are <a id="position_N"> where N equals hierarchy position
(where menu item is not a link, the <li> is assigned the id instead)
dashes replace dots, e.g. <a id="position_2-1-3">
*}

{if $count > 0}
<ul id="menu">
{foreach from=$nodelist item=node}
  {if $node->depth > $node->prevdepth}
    {repeat string="<ul id=\"menu_`$prevlevel`\">" times=$node->depth-$node->prevdepth}
  {elseif $node->depth < $node->prevdepth}
    {repeat string="</li></ul>" times=$node->prevdepth-$node->depth}
    </li>
  {elseif $node->index > 0}</li>
  {/if}

{assign var='prevlevel' value=$node->hierarchy|replace:'.':'-'}

{if $node->current == true}
<li><a href="{$node->url}" id="position_{$node->hierarchy|replace:'.':'-'}" class="currentpage"{if $node->target ne ""} target="{$node->target}"{/if}> {$node->menutext} </a>

{elseif $node->parent == true && $node->depth == 1 and $node->type != 'sectionheader' and $node->type != 'separator'}
<li class="activeparent"> <a href="{$node->url}" id="position_{$node->hierarchy|replace:'.':'-'}" class="activeparent"{if $node->target ne ""} target="{$node->target}"{/if}> {$node->menutext} </a>

{elseif $node->type == 'sectionheader'}
<li class="sectionheader" id="position_{$node->hierarchy|replace:'.':'-'}">{$node->menutext}

{elseif $node->type == 'separator'}
<li style="list-style-type: none;" id="position_{$node->hierarchy|replace:'.':'-'}"> <hr class="separator" />

{else}
<li><a href="{$node->url}" id="position_{$node->hierarchy|replace:'.':'-'}"{if $node->target ne ""} target="{$node->target}"{/if}> {$node->menutext} </a>

{/if}

{/foreach}

{repeat string="</li></ul>" times=$node->depth-1}</li>
</ul>
{/if}

_________________
eternity (n); 1. infinite time, 2. a seemingly long or endless time, 3. the length of time it takes a frozen pizza to cook when you're starving.
4,930,000,000 (n); 1. a very large number, 2. the approximate world population in 1986 when Microsoft Corp issued its IPO. 3. Microsoft's net profit (USD) for the quarter (3 months) ending 31 March 2007.
CMSMS migration and setup services | Hosting with CMSMS installed and ready to go | PM me for Info


Last edited by kermit on Wed Jul 07, 2010 11:00 am, edited 1 time in total.

Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Insert ID for horizontal drop line menu
PostPosted: Thu Jul 08, 2010 3:21 am 
Offline
Forum Members
Forum Members

Joined: Fri Jun 11, 2010 7:55 am
Posts: 19
My sincerely thank Admin and Kermit very much!

Now, I can do it myself  :D


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Hosting Nation - Managed CMSMS Hosting