Hast Du das Template umbenannt und dann eingebunden ?
Hast Du das Template umbenannt und dann eingebunden ?
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.
über die letzten Jahre (!!) hat sich das Grund-Template ein wenig verändert.
Hier die neuere Version:
was hat sich geändert: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(); ?>
diesind durchHTML-Code:<!-- Indexer -->
,PHP-Code:
<?php $this->extend('block_unsearchable'); ?>
undPHP-Code:
<?php $this->block('content'); ?>
ersetzt.PHP-Code:
<?php $this->endblock(); ?>
Die Überschrift ist ebenfalls aus diesem Template entfallen (wird durch ein anderes Template übernommen)
Geändert von µaTh (25.12.2017 um 17:28 Uhr)
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 in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)
Lesezeichen