Results 1 to 4 of 4

Thread: Menu theming question

  1. #1
    User
    Join Date
    12-11-09.
    Location
    New York, NY USA
    Posts
    87

    Default Menu theming question

    Hi All,

    Its been a while since I had to theme Contao.

    I have an existing site that now needs a third level menu. The main menu navigation is working correctly with three levels of nested ULs

    However, when I'm in a section I show the secondary menu items and now need to the third level as well.

    For some reason the nav_left template does not generate the expected nested ULs for the third level. it is treating the third level as a second level LI.

    Can someone clue me in?

    my nav_left template
    Code:
    <ul <?php if ($this->level == 'level_1') { echo 'id="navigation"'; } ?>
        class="<?php echo $this->level; ?>">
    
      <?php 
         foreach ($this->items as $item) {  
       
         if ($item['isActive'] && $this->level == 'level_1') {   
          ?>
          <li class="selected<?php if ($item['class']) {  /*echo $item['class'];*/ } ?>">
            <?php echo $item['link']; ?>
            <?php echo $item['subitems']; ?>
          
        <?php } else { 
      
        ?>
           <li <?php if ($item['class']) { ?> class="<?php echo $item['class']; ?>"<?php } ?>>
         <a href="<?php echo $item['href']; ?>" title="<?php echo $item['pageTitle'] ? $item['pageTitle'] : $item['title']; ?>"
           <?php if ($item['class']) { ?> class="<?php echo $item['class']; ?>" <?php } ?>
           <?php if ($item['accesskey'] != ''){ ?> accesskey="<?php echo $item['accesskey']; ?>" <?php } ?>
           <?php if ($item['tabindex']) { ?> tabindex="<?php echo $item['tabindex']; ?>" <?php } ?>
           <?php if ($item['nofollow']) { ?> rel="nofollow" <?php } ?> 
           onclick="this.blur();<?php echo $item['target']; ?>"><?php echo $item['link'];   
           if ($this->level == 'level_1') { echo""; } ?></a>
         <?php echo $item['subitems']; ?> 
      <?php 
            
    }  
      } //endforeach  
      ?>[/list]

  2. #2
    User
    Join Date
    06-29-09.
    Posts
    271

    Default Re: Menu theming question

    Does the original nav file have the problem?

    If not I always find it to work the best is to use the original as a basis and re-add all the changes you made from your own version. Continue doing this until everything is in or you encounter the problem (solve it 8-) )

  3. #3
    User
    Join Date
    12-11-09.
    Location
    New York, NY USA
    Posts
    87

    Default Re: Menu theming question

    Hmm, I must be going about this the wrong way. I have snooped around a bit and it appears nearly identical.

    The thing is the main nav (nav_default.tpl) produces the expected structure whereas (nav_left,tpl) does not. I tried pasting the code from nav_default.tpl to see what would happen, it produces links but not the ul structure as it does in the main nav.

    It seems like there is no "Level 2" "Level3" being generated in the left column.

    The $this->header produces different content then $this-left. obvious enough but I want the nested ul structure it produces.

    I'll hit it again tomorrow with fresh eyes.

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

    Default Re: Menu theming question

    So you're asking that when a level_2 menu item is active, you also want level_3 to be visible? or if a level_1 menu item is active, you want level_2 AND level_3 to be visible?

    Also, I noticed the coding specifies only level_1... I'm wondering, did you use a "Custom Navigation" module as opposed to a standard "Navigation" module when you built the left_nav?

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
  •