ce_text Template p-Element Klasse hinzufügen
Liebe Mitglieder,
leider verzweifel ich gerade. Ich fand keine Infos zum p-Element vom ce-Text Template.
Ich versuche das ce_text Template zu bearbeiten.
Ich möchte für das darin ausgegebene <p>-Element für den Artikel-Text ein class einfügen.
Aus dem Standard soll ein
HTML-Code:
<p class="container-text">...</p>
werden.
Der Artikel-Text scheint hiermit
Code:
<?php if (!$this->addBefore): ?>
<?= $this->text ?>
<?php endif; ?>
abgerufen zu werden.
Ich komme leider nur nicht darauf, wie vie hier das p-Element bearbeiten kann bzw. hier ihm eine class/id zuweisen kann.
Mein ce_text-Template sieht bislang so aus:
Code:
<div class="container <?= $this->class ?> block"<?= $this->cssID ?><?php if ($this->style): ?> style="<?= $this->style ?>"<?php endif; ?>>
<?php if ($this->headline): ?>
<<?= $this->hl ?> class="container-header"><?= $this->headline ?></<?= $this->hl ?>>
<?php endif; ?>
<?php $this->block('content'); ?>
<?php if (!$this->addBefore): ?>
<?= $this->text ?>
<?php endif; ?>
<?php if ($this->addImage): ?>
<figure class="image_container<?= $this->floatClass ?>"<?php if ($this->margin): ?> style="<?= $this->margin ?>"<?php endif; ?>>
<?php if ($this->href): ?>
<a href="<?= $this->href ?>"<?php if ($this->linkTitle): ?> title="<?= $this->linkTitle ?>"<?php endif; ?><?= $this->attributes ?>>
<?php endif; ?>
<?php $this->insert('picture_default', $this->picture); ?>
<?php if ($this->href): ?>
</a>
<?php endif; ?>
<?php if ($this->caption): ?>
<figcaption class="caption"><?= $this->caption ?></figcaption>
<?php endif; ?>
</figure>
<?php endif; ?>
<?php if ($this->addBefore): ?>
<?= $this->text ?>
<?php endif; ?>
</div>
Liste der Anhänge anzeigen (Anzahl: 2)
Es geht um eine Übersichtsseite mit verschiedenen optische Blöcke (Class=Container) in der Hauptspalte.
Jedes dieser Blöcke besitzt eine Überschrift (wie "Willkommen", "Neuigkeiten", Login, etc.), darunter folgt ggf. Text/Artikeltext/ oder die Funktion.
HTML-Code:
(...)
<div id="main">
<div class="container">
<header class="container-header">
<h2 class="cubeheader">Willkommen</h2>
<p class="container-text">Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus </p>
<a href="" class="more">Mehr</a>
</header>
</div>
(...) (Weitere Container)
</div>
(...)
In meiner reinen HTML-Vorlage hatte ich die Margin-Abstände von p eines(! der erste) dieser Blöcke angesprochen.
Jetzt hatte ich aktuell einfach die 1:1 Umsetzung meiner HTML-Vorlage ins Cantao verfolgt und prallte auf das Problem mit dem P-Element im Template.
Das CSS für p soll nicht für alle gelten, sondern nur für ein bestimmtes, in meinem Fall das erste Container-Div, da dieses am linken Rand steht und dort immer stehen bleibt.
Ich möchte für <p> innerhalb des ersten Container-Divs (class="Container") diesen CSS verwenden:
Code:
box-sizing: border-box;
margin-right: 10px;
margin-top: 5px;
margin-bottom: 5px;