Hi,
ich möchte in einem Template etwas an der Überschrift von mod_newslist drehen. In welchem template kann ich das machen?
Hi,
ich möchte in einem Template etwas an der Überschrift von mod_newslist drehen. In welchem template kann ich das machen?
ich nehme mal an, das Du mit html5 unterwegs bist. Dann -> mod_newslist.html5 ansonsten das xhtml-Pendant
mod_newslest (in 3.3.6) schaut so aus,, das isses doch nicht, oder?
Ich halte nach dem Ausschau, wie in ce_text:HTML-Code:<?php $this->extend('block_unsearchable'); ?> <?php $this->block('content'); ?> <?php if (empty($this->articles)): ?> <p class="empty"><?php echo $this->empty; ?></p> <?php else: ?> <?php echo implode('', $this->articles); ?> <?php echo $this->pagination; ?> <?php endif; ?> <?php $this->endblock(); ?>
Code:<?php if ($this->headline): ?> <<?php echo $this->hl; ?>><?php echo $this->headline; ?></<?php echo $this->hl; ?>> <?php endif; ?>
Du bist im falschen Template. Du musst eins von den news_xxx.html5 nehmen. Das was du im Modul eingestellt hast.
nl_default, da isses aber auch nich
Code:<?php $this->extend('block_unsearchable'); ?> <?php $this->block('content'); ?> <form<?php if ($this->action): ?> action="<?php echo $this->action; ?>"<?php endif; ?> id="<?php echo $this->formId; ?>" method="post"> <div class="formbody"> <input type="hidden" name="FORM_SUBMIT" value="<?php echo $this->formId; ?>"> <input type="hidden" name="REQUEST_TOKEN" value="{{request_token}}"> <?php if ($this->message): ?> <p class="<?php echo $this->mclass; ?>"><?php echo $this->message; ?></p> <?php endif; ?> <?php if (!$this->showChannels): ?> <?php foreach ($this->channels as $id=>$title): ?> <input type="hidden" name="channels[]" value="<?php echo $id; ?>"> <?php endforeach; ?> <?php endif; ?> <label for="ctrl_email_<?php echo $this->id; ?>" class="invisible"><?php echo $this->emailLabel; ?></label> <input type="text" name="email" id="ctrl_email_<?php echo $this->id; ?>" class="text" value="<?php echo $this->email; ?>" placeholder="<?php echo $this->emailLabel; ?>"> <?php if ($this->showChannels): ?> <label for="ctrl_channels_<?php echo $this->id; ?>" class="invisible"><?php echo $this->channelsLabel; ?></label> <div id="ctrl_channels_<?php echo $this->id; ?>" class="checkbox_container"> <?php foreach ($this->channels as $id=>$title): ?> <span><input type="checkbox" name="channels[]" id="opt_<?php echo $this->id; ?>_<?php echo $id; ?>" value="<?php echo $id; ?>" class="checkbox"> <label for="opt_<?php echo $this->id; ?>_<?php echo $id; ?>"><?php echo $title; ?></label></span> <?php endforeach; ?> </div> <?php endif; ?> <input type="submit" name="submit" class="submit" value="<?php echo $this->submit; ?>"> </div> </form> <?php $this->endblock(); ?>
nl_default? Wieso bist du auf einmal bei einem Newslettertemplate? Ich sagte news_xxx.html5 :-)
Bzw. schau einfach welches Template im Modul der Newsliste eingestellt ist. Siehe Anhang.
Geändert von Kahmoon (27.03.2015 um 16:07 Uhr)
Hust :-)
Mit dem Newsletter ist aber noch mal dasselbe Spiel, da muss ich auch an die Überschrift dran.
Aber news_simple ist erst mal das Gewünschte: Da ist die Headline aber schon fix und fertig, und ich würde gerne ein h5 in ein "span" wandeln.
Code:<div class="layout_simple block<?php echo $this->class; ?>"> <time datetime="<?php echo $this->datetime; ?>"> <div class="date_box_day"><?php echo $this->parseDate("d", $this->timestamp); ?></div> <div class="date_box_month"><?php echo $this->parseDate("M", $this->timestamp); ?></div> </time> <?php if ($this->addImage): ?> <figure class="image_container<?php echo $this->floatClass; ?>"<?php if ($this->margin || $this->float): ?> style="<?php echo trim($this->margin . $this->float); ?>"<?php endif; ?>> <?php if ($this->href): ?> <a href="<?php echo $this->href; ?>"<?php echo $this->attributes; ?> title="<?php echo $this->alt; ?>"> <?php endif; ?> <img src="<?php echo $this->src; ?>"<?php echo $this->imgSize; ?> alt="<?php echo $this->alt; ?>"> <?php if ($this->href): ?> </a> <?php endif; ?> <?php if ($this->caption): ?> <figcaption class="caption" style="width:<?php echo $this->arrSize[0]; ?>px"><?php echo $this->caption; ?></figcaption> <?php endif; ?> </figure> <?php endif; ?> <?php echo $this->linkHeadline; ?> <div class="clear"></div> </div>
Also im news_latest.html5 z.B. is:
Das kannst du doch beliebig ändern?Code:<h3><?php echo $this->text ? $this->linkHeadline : $this->newsHeadline; ?></h3>
Verstehe ich nicht. Hab's nicht gecheckt, aber in linkHeadline müssen doch die h-Tags doch schon drin sein? Und was ist newsHeadline?PHP-Code:
<h3><?php echo $this->text ? $this->linkHeadline : $this->newsHeadline; ?></h3>
Hi,
das "Problem" ist die Templatevererbung.
Inhalt von block_unsearchable:Code:<?php $this->extend('block_unsearchable'); ?> <?php $this->block('content'); ?> <form<?php if ($this->action): ?> action="<?php echo $this->action; ?>"<?php endif; ?> id="<?php echo $this->formId; ?>" method="post"> <div class="formbody"> <input type="hidden" name="FORM_SUBMIT" value="<?php echo $this->formId; ?>"> <input type="hidden" name="REQUEST_TOKEN" value="{{request_token}}"> <?php if ($this->message): ?> <p class="<?php echo $this->mclass; ?>"><?php echo $this->message; ?></p> <?php endif; ?> <?php if (!$this->showChannels): ?> <?php foreach ($this->channels as $id=>$title): ?> <input type="hidden" name="channels[]" value="<?php echo $id; ?>"> <?php endforeach; ?> <?php endif; ?> <label for="ctrl_email_<?php echo $this->id; ?>" class="invisible"><?php echo $this->emailLabel; ?></label> <input type="text" name="email" id="ctrl_email_<?php echo $this->id; ?>" class="text" value="<?php echo $this->email; ?>" placeholder="<?php echo $this->emailLabel; ?>"> <?php if ($this->showChannels): ?> <label for="ctrl_channels_<?php echo $this->id; ?>" class="invisible"><?php echo $this->channelsLabel; ?></label> <div id="ctrl_channels_<?php echo $this->id; ?>" class="checkbox_container"> <?php foreach ($this->channels as $id=>$title): ?> <span><input type="checkbox" name="channels[]" id="opt_<?php echo $this->id; ?>_<?php echo $id; ?>" value="<?php echo $id; ?>" class="checkbox"> <label for="opt_<?php echo $this->id; ?>_<?php echo $id; ?>"><?php echo $title; ?></label></span> <?php endforeach; ?> </div> <?php endif; ?> <input type="submit" name="submit" class="submit" value="<?php echo $this->submit; ?>"> </div> </form> <?php $this->endblock(); ?>
LÖSUNG: überschreibe die vorhandene Templatedatei mit dem Inhalt des geerbten Inhalts und ändere dann die ÜberschriftCode:<!-- indexer::stop --> <div 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; ?> <?php $this->block('content'); ?> <?php $this->endblock(); ?> </div> <!-- indexer::continue -->
Code:<!-- indexer::stop --> <div 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; ?><?php $this->extend('block_unsearchable'); ?><?php $this->block('content'); ?><form<?php if ($this->action): ?> action="<?php echo $this->action; ?>"<?php endif; ?> id="<?php echo $this->formId; ?>" method="post"> <div class="formbody"> <input type="hidden" name="FORM_SUBMIT" value="<?php echo $this->formId; ?>"> <input type="hidden" name="REQUEST_TOKEN" value="{{request_token}}"> <?php if ($this->message): ?> <p class="<?php echo $this->mclass; ?>"><?php echo $this->message; ?></p> <?php endif; ?> <?php if (!$this->showChannels): ?> <?php foreach ($this->channels as $id=>$title): ?> <input type="hidden" name="channels[]" value="<?php echo $id; ?>"> <?php endforeach; ?> <?php endif; ?> <label for="ctrl_email_<?php echo $this->id; ?>" class="invisible"><?php echo $this->emailLabel; ?></label> <input type="text" name="email" id="ctrl_email_<?php echo $this->id; ?>" class="text" value="<?php echo $this->email; ?>" placeholder="<?php echo $this->emailLabel; ?>"> <?php if ($this->showChannels): ?> <label for="ctrl_channels_<?php echo $this->id; ?>" class="invisible"><?php echo $this->channelsLabel; ?></label> <div id="ctrl_channels_<?php echo $this->id; ?>" class="checkbox_container"> <?php foreach ($this->channels as $id=>$title): ?> <span><input type="checkbox" name="channels[]" id="opt_<?php echo $this->id; ?>_<?php echo $id; ?>" value="<?php echo $id; ?>" class="checkbox"> <label for="opt_<?php echo $this->id; ?>_<?php echo $id; ?>"><?php echo $title; ?></label></span> <?php endforeach; ?> </div> <?php endif; ?> <input type="submit" name="submit" class="submit" value="<?php echo $this->submit; ?>"> </div> </form><?php $this->endblock(); ?></div> <!-- indexer::continue -->
Geändert von the_scrat (27.03.2015 um 16:29 Uhr)
Programmers don't comment their code. It was hard to write, it should be hard to understand...
@Kahmoon
$this->linkHeadline ist die Überschrift eines News-Eintrages. Ich suche aber die Überschrift, die man im Modul einträgt. Haben wir wohl aneinader vorbeigschrieben :-)
@the_scrat
Ich musste also in mod_newslist das extend ersetzen.
Jetzt habe ich das selbe Spiel noch mal in einer Anmeldung für einen Newsletter. Im Quellcode steht mod_subscribe, der Modultyp ist Abonnieren. Welches Template ist das? Wenn ich bei den Templates nach Newsletter oder subscribe suche, finde ich nix Passendes.
Na schau doch einfach im Ordner nach was es für Templates gibt?!
/system/modules/newsletter/templates/
So viele sind das nicht....
mod_newsletter
mod_newsletter_list
mod_newsletter_reader
nl_default
Und bei allen das gleiche Spiel, das Template holt sich die Überschrift aus dem Template block_(un)searchable. Und da ist nur die Überschrift enthalten. Also entferne das $this->extend() und das $this->block und hol dir den fehlenden Inhalt direkt aus dem Eltern-Template.
Edit:
War das eine Frage? Ja, in mod_newslist musst du das natürlich ersetzen. Bzw. erstell dir am besten eine "Kopie" von dieser Datei im /templateverzeichnis und mach dort deine Änderungen. Im Modul wählst du dann dein eigenes Template aus
Geändert von the_scrat (27.03.2015 um 17:39 Uhr)
Programmers don't comment their code. It was hard to write, it should be hard to understand...
Auf nl_default bin ich nicht gekommen. Macht dann also auch Sinn, mal einfach unter der Überschrift zu suchen, ich hab immer nur getippt ... THANKS!
Hallo zusammen,
danke schon mal den Part der hier bereits steht, hat mir unabhängig meines Problem bereits auch schon geholfen. (:
Ich möchte gerne in einer Newslist, die Überschrift der Kategorie der gezeigen Liste ausgeben lassen.
Das ich die
dafür bearbeiten muss is mir bewusst, nur wie greife ich die Überschrift der entsprechenden angezeigten Kategorie ab?HTML-Code:mod_newslist
Danke für jede Hilfe.
Gruß gecki
Falls du mehrere Kategorien hast würde ich zu einer Erweiterung greifen:
https://github.com/codefog/contao-news_categories
falls du nur wenige News Archive hast und diese als Kategorie verwendest musst du dir den Name aus den Template Variablen herausholen.
im mod_newslist z.B.
Schlüsselt den $this Array auf.Code:<?php $this->showTemplateVars(); ?>
Das Erweiterung
nutze ich bereits. Is auch super (:HTML-Code:contao-news_categories
Anbei eine Übersicht meiner Kategorien, falls das hilft.
Bildschirmfoto 2018-09-19 um 09.59.22.png
Bsp.: Momentan lasse ich alle Inhlate die zur Kategorie "Austria" zählen auf einer Seite ausgeben. Wie bekommt ich "Austria" als Überschrift auf die Seite, sodass sie überallen Inhalten (die mittels news_full ausgegeben werden) erscheint.
Sry falls ich mich davor zu ungenau ausgedrückt habe.
Gruß
Hast du dir die Anleitung von codefog angeschaut?
https://github.com/codefog/contao-news_categories
Ich verwende bei einzelnen Kategorien im Template dannPHP-Code:
$this->categorie_fe
ja, ich hab sie überflogen.
Eben beim Lesen habe ich das gesehen:
Funktioniert super damit.HTML-Code:{{news_categories::title}} - prints category title
Danke dir trotzdem (:
Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)
Lesezeichen