{* Everything that has to stay visible while the section is pinned lives inside the sticky viewport: the header zone (brick content + counter) and the card track. The stage breaks out to the full width of the surrounding box, the header gets the container width back through its own .qui-content-grid. *}
{if $this->getAttribute('showTitle') && $this->getAttribute('frontendTitle')}

{$this->getAttribute('frontendTitle')|escape:'html'}

{/if} {if $this->getAttribute('content') != ""}
{$this->getAttribute('content')}
{/if}
{if $showCounter}

{/if}
    {foreach $cards as $card}
  • {if $card.hasMedia}
    {if $card.title != ''} {image src=$card.image class="quiqqer-presentationBricks-scrollPinnedCards__cardImage" alt="{$card.title|escape:'html'}" } {else} {image src=$card.image class="quiqqer-presentationBricks-scrollPinnedCards__cardImage" alt="" } {/if}
    {/if} {if $card.hasText}
    {* The text block is a growing wrapper: with "buttons on one line" it eats the free space of the card and pushes the button to the lower edge, otherwise it keeps its content height. Either way the vertical alignment applies - inside the wrapper when it grows, to the whole group when it does not. *}
    {if $card.showNumber} {/if} {if $card.eyebrow != ''}

    {$card.eyebrow|escape:'html'}

    {/if} {* icon and title share one row, the icon sits left of the headline. Without a title the row carries the icon alone. *} {if $card.hasIcon || $card.title != ''}
    {if $card.hasIcon} {if $card.iconIsImage} {image src=$card.icon class="quiqqer-presentationBricks-scrollPinnedCards__cardIconImage" alt="" } {else} {/if} {/if} {if $card.title != ''}

    {$card.title|escape:'html'}

    {/if}
    {/if} {if $card.content != ''}
    {$card.content}
    {/if}
    {if $card.hasButton}

    {if $card.buttonIcon != '' && $card.buttonIconPosition == 'start'} {/if} {$card.buttonText|escape:'html'} {if $card.buttonIcon != '' && $card.buttonIconPosition == 'end'} {/if}

    {/if}
    {/if} {* The second text area carries nothing but its content: no number, no headline, no button. That keeps it predictable to style with own CSS, which is what it exists for. *} {if $card.hasSecondary}
    {$card.contentSecondary}
    {/if}
  • {/foreach}
{if $mayPin} {* The last of the five pin conditions that is still open at this point: does JavaScript exist at all. The device conditions are media queries in the stylesheet, the number of cards was decided in PHP - this line only contributes the class they all hang on. It is deliberately inline and classic: it runs while the document is parsed, so the pinned presentation is part of the first paint instead of replacing the stacked one a moment later. Without JavaScript the class never appears and the cards stay stacked, which is the fallback the whole control is built on. *} {literal} {/literal} {/if}