Änderungsvorschlag für Template nav_moomenu.tpl

Einklappen
X
 
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge
  • kos
    Contao-Fan
    • 22.06.2009
    • 888

    #1

    Änderungsvorschlag für Template nav_moomenu.tpl

    Hallo Andreas,

    im Standard-Navigations-Template von Contao nav_default.tpl werden die aktiven Links durch
    <span class="active">...</span> dargestellt.

    Im Template nav_moomenu.tpl wird aber hier (wie früher auch in TL)
    <p class="active">...</p> benutzt.

    Wäre es nicht sinnvoll, das anzugleichen?
  • andreas.schempp
    Contao Core-Team
    Association Vorstand
    • 15.06.2009
    • 5701

    #2
    Doch, das werd ich irgendwann machen...
    Schon vor mehr als einem Jahr habe ich (mit Hilfe) das Modul weiterentwickelt aber nie feretig gestellt. deshalb ist es nie veröffentlicht...
    terminal42 gmbh
    Wir sind Contao Premium-Partner! Für Modulwünsche oder Programmierungen kannst du uns gerne kontaktieren.
    Hilfe für Isotope eCommerce kann man auch kaufen: Isotope Circle

    Kommentar

    • kos
      Contao-Fan
      • 22.06.2009
      • 888

      #3
      Hallo Andreas,

      Zitat von andreas.schempp Beitrag anzeigen
      Doch, das werd ich irgendwann machen...
      Schon vor mehr als einem Jahr habe ich (mit Hilfe) das Modul weiterentwickelt aber nie feretig gestellt. deshalb ist es nie veröffentlicht...
      Ich glaube, hier reden wir etwas aneinander vorbei.
      Das besagte Template ist Bestandteil Deiner Erweiterung mootoolsnav, die Du gerade erst für CTO 2.9 freigegeben hast - dann ist sie doch fertig, oder?. Ich vermute daher, bei obiger Aussage hattest Du eine andere Deiner vielen Extensions im Sinn.

      Ich binde hier mal den Code ein:

      Istzustand des Templates nav_moomenu.tpl:
      PHP-Code:
      <?php
      
        $togglerlevel = 'level_1';
        $menulevel = 'level_2';
      
      ?>
      
      <ul class="<?php echo $this->level; if($this->level == $menulevel) echo ' menuaccord" onmouseover="moomenu_stop()" onmouseout="moomenu_fire()'; ?>">
      <?php if (!isset($GLOBALS['accorditem'][$this->level])) $GLOBALS['accorditem'][$this->level] = 0; ?>
      
      <?php foreach($this->items as $item): ?>
      
      <?php if ($item['isActive']): ?>
      
      <?php if(empty($item['subitems'])): /* Ohne Untermenüs */ ?>
      
      <li class="<?php if ($item['class']) echo $item['class']; ?><?php if($this->level == $togglerlevel) echo ' nosubmenu'; ?>"><p class="active <?php if ($item['class']): ?> <?php echo $item['class']; endif; ?>"><?php echo $item['link']; ?></p></li>
      
      <?php else: /* Mit Untermenüs */ ?>
      <?php if ($this->level == $togglerlevel) $GLOBALS['activemenuaccord'] = $GLOBALS['accorditem'][$this->level]; ?>
      <li class="active <?php if ($item['class']) echo $item['class']; ?><?php if($this->level == $togglerlevel): ?> menutoggler<?php endif; ?>"><p class="active <?php if ($item['class']): ?> <?php echo $item['class']; endif; ?>"<?php if($this->level == $togglerlevel): ?> onmouseover="moomenu.accordion.display(<?php echo $GLOBALS['accorditem'][$this->level]; ?>)" onmouseout="moomenu.accordion.display(activemenuaccord)"<?php endif; ?>><?php echo $item['link']; ?></p><?php echo $item['subitems']; ?></li>
      <?php $GLOBALS['accorditem'][$this->level]++; ?>
      <?php endif; ?>
      <?php else: ?>
      
      <?php if ($this->level == $togglerlevel && strpos($item['class'], 'trail') !== false) $GLOBALS['activemenuaccord'] = $GLOBALS['accorditem'][$this->level]; ?>
      
      <?php if($this->level == $togglerlevel): /* Level 1 */ ?>
      
      <?php if(empty($item['subitems'])): /* Ohne Untermenüs */ ?>
      
      <li class="<?php if ($item['class']) echo $item['class']; ?> nosubmenu" onmouseover="moomenu_stop()" onmouseout="moomenu_fire()"><a href="<?php echo $item['href']; ?>"<?php if ($item['class']): ?> class="<?php echo $item['class']; ?>"<?php endif; ?><?php if ($item['accesskey'] != ''): ?> accesskey="<?php echo $item['accesskey']; ?>"<?php endif; if ($item['tabindex']): ?> tabindex="<?php echo $item['tabindex']; ?>"<?php endif; ?> onclick="this.blur();<?php echo $item['target']; ?>"><?php echo $item['link']; ?></a></li>
      
      <?php else: /* Mit Untermenüs */ ?>
      <li class="<?php if ($item['class']) echo $item['class']; ?> menutoggler"><a href="<?php echo $item['href']; ?>"<?php if ($item['class']): ?> class="<?php echo $item['class']; ?>"<?php endif; ?><?php if ($item['accesskey'] != ''): ?> accesskey="<?php echo $item['accesskey']; ?>"<?php endif; if ($item['tabindex']): ?> tabindex="<?php echo $item['tabindex']; ?>"<?php endif; ?> onclick="this.blur();<?php echo $item['target']; ?>" onmouseover="moomenu_display(<?php echo $GLOBALS['accorditem'][$this->level]; ?>)" onmouseout="moomenu_fire()"><?php echo $item['link']; ?></a><?php echo $item['subitems']; ?></li>
      <!-- count accorditem -->
      <?php $GLOBALS['accorditem'][$this->level]++; ?>
      <?php endif; ?>
      
      <?php else: /* Level 2 oder höher */ a?>
      
      <li class="<?php if ($item['class']) echo $item['class']; ?>"><a href="<?php echo $item['href']; ?>"<?php if ($item['class']): ?> class="<?php echo $item['class']; ?>"<?php endif; ?><?php if ($item['accesskey'] != ''): ?> accesskey="<?php echo $item['accesskey']; ?>"<?php endif; if ($item['tabindex']): ?> tabindex="<?php echo $item['tabindex']; ?>"<?php endif; ?> onclick="this.blur();<?php echo $item['target']; ?>"><?php echo $item['link']; ?></a><?php echo $item['subitems']; ?></li>
      
      <?php endif; ?>
      
      <?php endif; ?>
      
      <?php endforeach; ?>
      </ul>
      und hier meine Änderungsvorschlag, der lediglich die Zeilen 17 und 21 betrifft ( das sind die ersten beiden Zeilen, die mit <li class=".. beginnen) :
      PHP-Code:
      <?php
      
        $togglerlevel = 'level_1';
        $menulevel = 'level_2';
      
      ?>
      
      <ul class="<?php echo $this->level; if($this->level == $menulevel) echo ' menuaccord" onmouseover="moomenu_stop()" onmouseout="moomenu_fire()'; ?>">
      <?php if (!isset($GLOBALS['accorditem'][$this->level])) $GLOBALS['accorditem'][$this->level] = 0; ?>
      
      <?php foreach($this->items as $item): ?>
      
      <?php if ($item['isActive']): ?>
      
      <?php if(empty($item['subitems'])): /* Ohne Untermenüs */ ?>
      
      <li class="<?php if ($item['class']) echo $item['class']; ?><?php if($this->level == $togglerlevel) echo ' nosubmenu'; ?>"><span class="active <?php if ($item['class']): ?> <?php echo $item['class']; endif; ?>"><?php echo $item['link']; ?></span></li>
      
      <?php else: /* Mit Untermenüs */ ?>
      <?php if ($this->level == $togglerlevel) $GLOBALS['activemenuaccord'] = $GLOBALS['accorditem'][$this->level]; ?>
      <li class="active <?php if ($item['class']) echo $item['class']; ?><?php if($this->level == $togglerlevel): ?> menutoggler<?php endif; ?>"><span class="active <?php if ($item['class']): ?> <?php echo $item['class']; endif; ?>"<?php if($this->level == $togglerlevel): ?> onmouseover="moomenu.accordion.display(<?php echo $GLOBALS['accorditem'][$this->level]; ?>)" onmouseout="moomenu.accordion.display(activemenuaccord)"<?php endif; ?>><?php echo $item['link']; ?></span><?php echo $item['subitems']; ?></li>
      <?php $GLOBALS['accorditem'][$this->level]++; ?>
      <?php endif; ?>
      <?php else: ?>
      
      <?php if ($this->level == $togglerlevel && strpos($item['class'], 'trail') !== false) $GLOBALS['activemenuaccord'] = $GLOBALS['accorditem'][$this->level]; ?>
      
      <?php if($this->level == $togglerlevel): /* Level 1 */ ?>
      
      <?php if(empty($item['subitems'])): /* Ohne Untermenüs */ ?>
      
      <li class="<?php if ($item['class']) echo $item['class']; ?> nosubmenu" onmouseover="moomenu_stop()" onmouseout="moomenu_fire()"><a href="<?php echo $item['href']; ?>"<?php if ($item['class']): ?> class="<?php echo $item['class']; ?>"<?php endif; ?><?php if ($item['accesskey'] != ''): ?> accesskey="<?php echo $item['accesskey']; ?>"<?php endif; if ($item['tabindex']): ?> tabindex="<?php echo $item['tabindex']; ?>"<?php endif; ?> onclick="this.blur();<?php echo $item['target']; ?>"><?php echo $item['link']; ?></a></li>
      
      <?php else: /* Mit Untermenüs */ ?>
      <li class="<?php if ($item['class']) echo $item['class']; ?> menutoggler"><a href="<?php echo $item['href']; ?>"<?php if ($item['class']): ?> class="<?php echo $item['class']; ?>"<?php endif; ?><?php if ($item['accesskey'] != ''): ?> accesskey="<?php echo $item['accesskey']; ?>"<?php endif; if ($item['tabindex']): ?> tabindex="<?php echo $item['tabindex']; ?>"<?php endif; ?> onclick="this.blur();<?php echo $item['target']; ?>" onmouseover="moomenu_display(<?php echo $GLOBALS['accorditem'][$this->level]; ?>)" onmouseout="moomenu_fire()"><?php echo $item['link']; ?></a><?php echo $item['subitems']; ?></li>
      <!-- count accorditem -->
      <?php $GLOBALS['accorditem'][$this->level]++; ?>
      <?php endif; ?>
      
      <?php else: /* Level 2 oder höher */ a?>
      
      <li class="<?php if ($item['class']) echo $item['class']; ?>"><a href="<?php echo $item['href']; ?>"<?php if ($item['class']): ?> class="<?php echo $item['class']; ?>"<?php endif; ?><?php if ($item['accesskey'] != ''): ?> accesskey="<?php echo $item['accesskey']; ?>"<?php endif; if ($item['tabindex']): ?> tabindex="<?php echo $item['tabindex']; ?>"<?php endif; ?> onclick="this.blur();<?php echo $item['target']; ?>"><?php echo $item['link']; ?></a><?php echo $item['subitems']; ?></li>
      
      <?php endif; ?>
      
      <?php endif; ?>
      
      <?php endforeach; ?>
      </ul>
      Durch diese Änderung würde dann die gleiche Auszeichnung benutzt wie im Standard-Template.

      Kommentar

      • andreas.schempp
        Contao Core-Team
        Association Vorstand
        • 15.06.2009
        • 5701

        #4
        Wir sprechen schon vom selben. Ich wollte die Erweiterung mal überarbeiten um z.B. das Level im Modul definieren zu können. Für 2.9 freigegeben habe ich sie, weil sie funktioniert ;-)
        terminal42 gmbh
        Wir sind Contao Premium-Partner! Für Modulwünsche oder Programmierungen kannst du uns gerne kontaktieren.
        Hilfe für Isotope eCommerce kann man auch kaufen: Isotope Circle

        Kommentar

        Lädt...