Contao-Camp 2024
Seite 2 von 2 ErsteErste 12
Ergebnis 41 bis 46 von 46

Thema: Nachrichtenarchiv Menü als Drop-Down-Menü

  1. #41
    Contao-Fan Avatar von WilhelmTell
    Registriert seit
    12.12.2014.
    Beiträge
    316

    Standard

    Hast Du das Template umbenannt und dann eingebunden ?

  2. #42
    Contao-Fan Avatar von Michael
    Registriert seit
    19.06.2009.
    Beiträge
    479

    Standard

    Ja.
    Contao ist echt !

  3. #43
    Contao-Fan Avatar von WilhelmTell
    Registriert seit
    12.12.2014.
    Beiträge
    316

    Standard

    Strange !

  4. #44
    Contao-Nutzer Avatar von Futzie 2
    Registriert seit
    31.08.2012.
    Beiträge
    44

    Standard

    Weltklasse Template!
    Sollte man in den Core aufnehmen.

    PS: bei mir läuft es unter 3.5.4 sowohl in den News als auch in den Events.

  5. #45
    Contao-Fan Avatar von µaTh
    Registriert seit
    13.05.2010.
    Beiträge
    950

    Standard

    über die letzten Jahre (!!) hat sich das Grund-Template ein wenig verändert.

    Hier die neuere Version:
    PHP-Code:
    <?php
    /*
    * @template: mod_newsmenu.tpl
    * @module:  News archive menu (Archive format: Month)
    * @function: news archiv menu as a drop-down-menu
    * @version: 1.2.0.m (2011-04-29)
    * @tested:  Contao 3.5.x
    * @author:  µaTh
    *
    * needs JavaScript enabled
    *
    * help and new free versions: (German bulletin board) http://www.contao-community.de/showthread.php?9291
    */
    ?>

    <?php $this->extend('block_unsearchable'); ?>

    <?php $this->block('content'); ?>

    <div class="<?php echo $this->class?> block"<?php echo $this->cssID?><?php if ($this->style): ?> style="<?php echo $this->style?>"<?php endif; ?>>


    <!-- noscript: if JavaScript is enabled show this message and do not show archiv menu -->
    <noscript><div class="noscript">Sorry, für das Archiv-Menü muss JavaScript in Ihrem Broswer eingeschalten sein</div></noscript>

    <!-- style="display:none;"
    hide the formular, if JavaScript is disabled.
    Form will shown by JavaScript at the end of code of this template
    -->
    <form id="ArchivNaviForm" style="display:none;" action="">
    <div class="ArchivNaviBlock">

    <!-- drop-down-menu start -->

    <!-- 
    JavaScript tests the selected row in drop-down-menu. 
    If it is not the first item (cause it is only text) 
    than reload the page and show the selected month 
    -->
    <select id="ArchivNavi" onchange="if (document.getElementById('ArchivNavi').selectedIndex != 0)  parent.location.href = this.form.ArchivNavi.options[ this.form.ArchivNavi.options.selectedIndex ].value;">

    <option selected="selected" value="">*** Auswahl Zeitraum *************************</option>

    <!-- each YEAR in drop-down-menu -->
    <?php foreach ($this->items as $year=>$months): ?>
      <!-- label YEAR -->
      <optgroup label="<?php echo $year?>">
      <!-- label MONTH start-->
    <?php foreach ($months as $month): ?>
      <option <?php if($month['isActive']): ?>selected="selected"<?php endif; ?> value="<?php echo $month['href']; ?>"><?php echo $month['link']; ?><?php if ($this->showQuantity): ?> (<?php echo $month['quantity']; ?>)<?php endif; ?></option>
    <?php endforeach; ?>
    <!-- label MONTH end -->
    </optgroup>
    <?php endforeach; ?>

    </select>
    <!-- drop-down-menu end -->

    <a href="javascript:if ( 1 < document.getElementById('ArchivNavi').options.selectedIndex ) parent.location.href = document.getElementById('ArchivNavi').options[ document.getElementById('ArchivNavi').options.selectedIndex -1].value;">Monat vor</a> | 
    <a href="javascript:if ( document.getElementById('ArchivNavi').length > document.getElementById('ArchivNavi').options.selectedIndex +1) parent.location.href = document.getElementById('ArchivNavi').options[ document.getElementById('ArchivNavi').options.selectedIndex +1].value;">Monat zurück</a>

    </div>
    </form>

    <!--
      JavaScript: show formular
    -->
    <script type="text/javascript">
    document.getElementById("ArchivNaviForm").style.display='inline';
    </script>


    </div>

    <?php $this->endblock(); ?>
    was hat sich geändert:
    die
    HTML-Code:
    <!-- Indexer -->
    sind durch
    PHP-Code:
    <?php $this->extend('block_unsearchable'); ?>
    ,
    PHP-Code:
    <?php $this->block('content'); ?>
    und
    PHP-Code:
    <?php $this->endblock(); ?>
    ersetzt.

    Die Überschrift ist ebenfalls aus diesem Template entfallen (wird durch ein anderes Template übernommen)

  6. #46
    Contao-Nutzer
    Registriert seit
    07.07.2009.
    Beiträge
    72

    Standard

    Vielen Dank für diese Skript das ist (fast) genau, wonach ich gesucht habe! Was muss ich denn tun, damit das Skript auch mit dem Archiv-Format "Jahr" statt Monat funktioniert? Also, ich möchte quasi, dass im Selectmenü nicht die Monate, sondern lediglich die Jahre aufgeführt und anwählbar sind.

Aktive Benutzer

Aktive Benutzer

Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)

Ähnliche Themen

  1. Nachrichtenarchiv-Menü-Archiv
    Von BerndDaniel im Forum Nachrichten/Events/FAQ
    Antworten: 4
    Letzter Beitrag: 23.01.2011, 23:45
  2. Drop-down Menü (select) mit default-Werten?
    Von somoza im Forum Entwickler-Fragen
    Antworten: 4
    Letzter Beitrag: 23.08.2010, 11:43
  3. CSS - Drop Down Menü für IE6 mit HTC-Datei (behaviour)
    Von Hueso im Forum Layout / Templates / Holy Grail
    Antworten: 6
    Letzter Beitrag: 11.05.2010, 18:19
  4. Hover Effekt / Drop Down Menü
    Von Fiete im Forum Layout / Templates / Holy Grail
    Antworten: 4
    Letzter Beitrag: 27.04.2010, 16:58

Lesezeichen

Lesezeichen

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •