ProcessWire - stickyFlags (Layoutblock): Unterschied zwischen den Versionen
Aus Wikizone
(Die Seite wurde neu angelegt: „Mit Sticky Flags sind kleine Fähnchen am Seitenrand gemeint. <syntaxhighlight lang="php"> <?php namespace ProcessWire; $content = ""; $imgWidth = '120'; $box…“) |
|||
| Zeile 1: | Zeile 1: | ||
| − | Mit Sticky Flags sind kleine Fähnchen am Seitenrand gemeint. | + | Mit Sticky Flags sind kleine Fähnchen am Seitenrand gemeint. Hier Klassen für ui-kit enthalten |
<syntaxhighlight lang="php"> | <syntaxhighlight lang="php"> | ||
<?php namespace ProcessWire; | <?php namespace ProcessWire; | ||
Aktuelle Version vom 6. Oktober 2018, 17:37 Uhr
Mit Sticky Flags sind kleine Fähnchen am Seitenrand gemeint. Hier Klassen für ui-kit enthalten
<?php namespace ProcessWire;
$content = "";
$imgWidth = '120';
$boxWidth = '60';
$vMargin = '3';
$elemHeight = 0;
$countFlags = count($page->repeater_sticky_flags);
$elemHeight = (intval($boxWidth)+intval($vMargin)) * $countFlags;
foreach($page->repeater_sticky_flags as $item){
$myImage = $item->single_image->width($imgWidth);
$content .= '<div class="sticky-flag" style="width:'.$boxWidth.'px;"><a href="'.$item->link.'" description=""><img src="'.$myImage->url.'" title="'.$item->text.'"></a></div>';
}
$content = wrap($content,'<div class="uk-position-fixed sticky-flags" style="margin-top:-'.$elemHeight.'px;">|</div>');
return $content;
CSS
fixed positionieren fertig