Ergebnis 1 bis 5 von 5

Thema: Jahre im Newsmenü ausblenden

  1. #1
    Contao-Nutzer
    Registriert seit
    27.08.2009.
    Ort
    Köln
    Beiträge
    22

    HTML Jahre im Newsmenü ausblenden

    Hallo,

    ich versuche momentan die Jahre aus dem Newsmenü auszublenden, da für jedes jahr ein eigenes Newsarchiv zur Verfügung steht. Ich weiß, dass das ganze im Template "mod_newsmenu" laufen muss, jedoch kriege ich das Jahr nicht gescheit rausprogrammiert.

    Hier der Code des Templates:

    HTML-Code:
    (...)
    <ul class="level_1">
    <?php foreach ($this->items as $year=>$months): ?>
      <li class="year submenu"><?php echo $year; ?> 
      <ul class="level_2">
    <?php foreach ($months as $month): ?>
    <?php if($month['isActive']): ?>
        <li class="active<?php if ($month['class']): ?> <?php echo $month['class']; endif; ?>"><span class="active"><?php echo $month['link']; ?><?php if ($this->showQuantity): ?> (<?php echo $month['quantity']; ?>)<?php endif; ?></span></li>
    <?php else: ?>
        <li<?php if ($month['class']): ?> class="<?php echo $month['class']; ?>"<?php endif; ?>><a href="<?php echo $month['href']; ?>" title="<?php echo $month['title']; ?>"><?php echo $month['link']; ?><?php if ($this->showQuantity): ?> (<?php echo $month['quantity']; ?>)<?php endif; ?></a></li>
    <?php endif; ?>
    <?php endforeach; ?>
      </ul>
      </li>
    <?php endforeach; ?>
    </ul>
    (...)
    Vielen Dank schonmal für eure Hilfe!

    Gruß,

    Johannes

  2. #2
    Contao-Nutzer
    Registriert seit
    09.07.2009.
    Beiträge
    25

    Standard

    Im Grunde müsste doch reichen:
    PHP-Code:

    <?php reset($this-items);
    $months current($this->items); ?>
    <ul class="level_1">
    <?php foreach ($months as $month): ?>
    <?php 
    if($month['isActive']): ?>
        <li class="active<?php if ($month['class']): ?> <?php echo $month['class']; endif; ?>"><span class="active"><?php echo $month['link']; ?><?php if ($this->showQuantity): ?> (<?php echo $month['quantity']; ?>)<?php endif; ?></span></li>
    <?php else: ?>
        <li<?php if ($month['class']): ?> class="<?php echo $month['class']; ?>"<?php endif; ?>><a href="<?php echo $month['href']; ?>" title="<?php echo $month['title']; ?>"><?php echo $month['link']; ?><?php if ($this->showQuantity): ?> (<?php echo $month['quantity']; ?>)<?php endif; ?></a></li>
    <?php endif; ?>
    <?php 
    endforeach; ?>
    </ul>

  3. #3
    Contao-Nutzer
    Registriert seit
    27.08.2009.
    Ort
    Köln
    Beiträge
    22

    Standard

    jo hat es auch. Hatte es inzwischen auch hingekriegt. Trotzdem danke!

  4. #4
    Contao-Nutzer
    Registriert seit
    10.11.2010.
    Beiträge
    14

    Standard den gleichen Code in der aktuellen Version 2.10.4 anpassen

    Hallo,

    leider ist php nicht meine Stärke.
    Der Code sieht in der aktuellen Version anders aus, sodass ich einen FEhler bekomme,
    wenn ich versuche die Jahreszahl auszublenden.

    Folgender Code ist es:
    Code:
    <!-- indexer::stop -->
    <nav class="<?php echo $this->class; ?> block"<?php echo $this->cssID; ?><?php if ($this->style): ?> style="<?php echo $this->style; ?>"<?php endif; ?>>
    <?php if ($this->headline): ?>
    
    <<?php echo $this->hl; ?>><?php echo $this->headline; ?></<?php echo $this->hl; ?>>
    <?php endif; ?>
    
    <ul class="level_1">
    <?php foreach ($this->items as $year=>$months): ?>
      <li class="year submenu"><?php echo $year; ?> 
      <ul class="level_2">
    <?php foreach ($months as $month): ?>
    <?php if($month['isActive']): ?>
        <li class="active<?php if ($month['class']): ?> <?php echo $month['class']; endif; ?>"><span class="active"><?php echo $month['link']; ?><?php if ($this->showQuantity): ?> (<?php echo $month['quantity']; ?>)<?php endif; ?></span></li>
    <?php else: ?>
        <li<?php if ($month['class']): ?> class="<?php echo $month['class']; ?>"<?php endif; ?>><a href="<?php echo $month['href']; ?>" title="<?php echo $month['title']; ?>"><?php echo $month['link']; ?><?php if ($this->showQuantity): ?> (<?php echo $month['quantity']; ?>)<?php endif; ?></a></li>
    <?php endif; ?>
    <?php endforeach; ?>
      </ul>
      </li>
    <?php endforeach; ?>
    </ul>
    
    </nav>
    <!-- indexer::continue -->
    Danke für eure Hilfe.

  5. #5
    Contao-Nutzer Avatar von djo
    Registriert seit
    30.01.2011.
    Ort
    Waldshut-Tiengen
    Beiträge
    210

    Staunendes Gesicht Newsbeitrag: Bestimmte Elemente weglassen

    Hallo zusammen,

    eine vielleicht nicht ganz so elegante aber doch elegante Langzeitwirkung habe ich durch Angaben im CSS-Code erreicht:

    PHP-Code:
    .mod_newslist .info
    {
     
    display:none

    ... und der Kittel ist geflickt.

    Liebe Grüße,
    Daniel

Aktive Benutzer

Aktive Benutzer

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

Ähnliche Themen

  1. Systemnachrichten ausblenden
    Von bird im Forum Layout / Templates / Holy Grail
    Antworten: 39
    Letzter Beitrag: 27.08.2014, 10:48
  2. Eventliste-Menü filtert keine Jahre
    Von andi-bar im Forum Nachrichten/Events/FAQ
    Antworten: 2
    Letzter Beitrag: 30.11.2010, 02:40
  3. Komplette Nachristenliste gruppiert nach Jahre
    Von cubano im Forum Nachrichten/Events/FAQ
    Antworten: 3
    Letzter Beitrag: 25.01.2010, 08:02
  4. Antworten: 3
    Letzter Beitrag: 24.06.2009, 18:09

Lesezeichen

Lesezeichen

Berechtigungen

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