Results 1 to 6 of 6

Thread: Expand only one of my menu items?

  1. #1
    User
    Join Date
    06-20-10.
    Posts
    64

    Default Expand only one of my menu items?

    Hi all,

    I have a menu using the following template:

    Code:
    <script language="JavaScript">
    <!--
    function Bildwechsel(Bildnr,Bildobjekt)
    {
    window.document.images[Bildnr].src = Bildobjekt.src;
    }
    //-->
    </script>
    
    <?php
    	$counter=1;
    	$flag=0;
    ?>
    
    <?php foreach ($this->items as $item): ?>
        <?php /*echo $this->level;*/ ?>
        <?php if ($item['isActive']): ?>
        
            <?php if($this->level == 'level_1'){  ?>
                <div id="navitem_firstlayer<?php echo $counter; ?>">
                <?php $counter++; ?>
                <a href="<?php echo $item['href'];?>"> 
                
                <?php if($cnt1+1<10){ ?>
    	[img]_wt_images/navigation/en_0<?php echo $cnt1+1; ?>_hi.png[/img]</a>	
                <?php }else{ ?>
    	[img]_wt_images/navigation/en_<?php echo $cnt1+1; ?>_hi.png[/img]</a>	
                <?php } ?>
                <?php $cnt1++; echo $item['subitems']?>
            <?php }  ?>
            
            
            <?php if($this->level == 'level_2'){  ?>
                <?php echo $item['title'];?>
    
                <?php $flag=1; ?>
                <?php $cnt1++; echo $item['subitems']?>
            <?php } ?>
            
            <?php if($this->level == 'level_3'){  ?>
                <?php echo "".$item['title'];?>
    
                <?php echo $item['subitems']?>
            <?php } ?>
            
            <?php if($this->level == 'level_4'){  ?>
                <?php echo "".$item['title'];?>
    
            <?php } ?>
            
            
            
        <?php else: ?>
        
        
        <?php if($this->level == 'level_1' ){ ?>
        <?php 
        $cnt = 1;
        $cnt++;
        if ($cnt == 5){$cnt=6;}
        $cnt1++;
        ?>
        <?php if($item['class'] == 'active'){?>
        
        <?php }  ?>
        
        <?php if($this->level == 'level_1' && !$item['isActive']){ ?>
            <div id="navitem_firstlayer<?php echo $counter; ?>">
                <?php $counter++; ?>
                <script language="JavaScript">
    				
    				<?php if($cnt1<10){ ?>
    					Normal<?php echo $cnt1; ?> = new Image(); 
    					Normal<?php echo $cnt1; ?>.src = "_wt_images/navigation/en_0<?php echo $cnt1; ?>_pl.png";
    				<?php }else{ ?>
    					Normal<?php echo $cnt1; ?> = new Image(); 
    					Normal<?php echo $cnt1; ?>.src = "_wt_images/navigation/en_<?php echo $cnt1; ?>_pl.png";	
                				<?php } ?>
    				
    				<?php if($cnt1<10){ ?>
    					Highlight<?php echo $cnt1; ?> = new Image(); 
    					Highlight<?php echo $cnt1; ?>.src = "_wt_images/navigation/en_0<?php echo $cnt1; ?>_hi.png";
    				<?php }else{ ?>
    					Highlight<?php echo $cnt1; ?> = new Image(); 
    					Highlight<?php echo $cnt1; ?>.src = "_wt_images/navigation/en_<?php echo $cnt1; ?>_hi.png";
                				<?php } ?>
                </script>
                
                
                <?php if($cnt1<10){ ?>
    	,Highlight<?php echo $cnt1; ?>)" onMouseOut="Bildwechsel(<?php echo $cnt1-1; ?>,Normal<?php echo $cnt1; ?>)">[img]_wt_images/navigation/en_0<?php echo $cnt1; ?>_pl.png[/img]
                <?php }else{ ?>
    	,Highlight<?php echo $cnt1; ?>)" onMouseOut="Bildwechsel(<?php echo $cnt1-1; ?>,Normal<?php echo $cnt1; ?>)">[img]_wt_images/navigation/en_<?php echo $cnt1; ?>_pl.png[/img]
                <?php } ?>
                
                <?php echo $item['subitems']; ?>
            </div>
        <?php }  ?>
        <?php }  ?>
        
        
        <?php if($this->level == 'level_2' ){ ?>
        <?php echo $item['title'];?>
    
        <?php $flag=1; ?>
        <?php $cnt1++; echo $item['subitems']?>
        <?php }  ?>
        
        <?php if($this->level == 'level_3' ){ ?>
        <?php echo "".$item['title'];?>
    
        <?php echo $item['subitems']?>
        <?php }  ?>
        
        <?php if($this->level == 'level_4' ){ ?>
        <?php echo "".$item['title'];?>
    
        <?php }  ?>
        
        <?php endif; ?>
        
    <?php endforeach; ?>
    
    <?php if($flag==1){ echo"</div>"; }else{if($cnt1==10){ echo"</div>";  }} ?>
    What I would like to do is this however:

    Menu1
    Menu2
    Menu3
    --Submenu1
    --Submenu2
    --Submenu3
    --Submenu4
    --Submenu5
    Menu4
    Menu5

    Basically I would like only a specific menu to be expanded by default.

    How could I achieve this?

    Thanks very much

  2. #2
    User
    Join Date
    01-22-11.
    Posts
    40

    Default Re: Expand only one of my menu items?

    That's exactly one of the things I am trying to do. If I find out anything from other sources I'll let you know. I assume you got no replies here? On a page of extreme length of links I just did away with all of them and used a self made linking system.

    Cheers, Andrei.

  3. #3
    User
    Join Date
    06-20-10.
    Posts
    64

    Default Re: Expand only one of my menu items?

    Hello all,

    Just bumping this again. Really need help with this. Please let me know if you need me to provide more information.

  4. #4
    Experienced user
    Join Date
    08-21-09.
    Posts
    563

    Default Re: Expand only one of my menu items?

    Brian

  5. #5
    User
    Join Date
    06-20-10.
    Posts
    64

    Default Re: Expand only one of my menu items?

    Hi I found a simple trick thanks to a colleague.

    I duplicated my "Home" page and moved it to the area I wanted to have open, for example "Offices". Then I turned the original "Home" page into an internal link which points to the new "Home" page in "Offices".

    So now when the website is visited, the Offices menu is expanded.

    Hope this helps others.

  6. #6
    User
    Join Date
    10-15-10.
    Posts
    279

    Default Re: Expand only one of my menu items?


    What I would like to do is this however:

    Menu1
    Menu2
    Menu3
    --Submenu1
    --Submenu2
    --Submenu3
    --Submenu4
    --Submenu5
    Menu4
    Menu5

    Basically I would like only a specific menu to be expanded by default.

    How could I achieve this?

    Thanks very much
    Ahh so even though you may NOT have Menu3 the current ACTIVE link, you still want Menu3's submenu to be expanded? A little strange to have a menu act in that way... I would think it will confuse visitors =/

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •