Skip to content

Commit

Permalink
Use the attr() method in templates
Browse files Browse the repository at this point in the history
  • Loading branch information
leofeyer committed May 15, 2024
1 parent 58352cf commit b8eaf2d
Show file tree
Hide file tree
Showing 22 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion core-bundle/contao/templates/block/block_searchable.html5
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

<div class="<?= $this->class ?> block"<?= $this->cssID ?><?php if ($this->style): ?> style="<?= $this->style ?>"<?php endif; ?>>
<div<?= $this->attr($this->cssID)->addClass([$this->class, 'block'])->addStyle($this->style) ?>>

<?php $this->block('headline'); ?>
<?php if ($this->headline): ?>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

<!-- indexer::stop -->
<div class="<?= $this->class ?> block"<?= $this->cssID ?><?php if ($this->style): ?> style="<?= $this->style ?>"<?php endif; ?>>
<div<?= $this->attr($this->cssID)->addClass([$this->class, 'block'])->addStyle($this->style) ?>>

<?php $this->block('headline'); ?>
<?php if ($this->headline): ?>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

<section class="<?= $this->class ?> ce_accordion ce_text block"<?= $this->cssID ?><?php if ($this->style): ?> style="<?= $this->style ?>"<?php endif; ?>>
<section<?= $this->attr($this->cssID)->addClass([$this->class, 'ce_accordion', 'ce_text', 'block'])->addStyle($this->style) ?>>

<div class="<?= $this->toggler ?>"<?php if ($this->headlineStyle): ?> style="<?= $this->headlineStyle ?>"<?php endif; ?>>
<?= $this->headline ?>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

<section class="<?= $this->class ?> ce_accordion block"<?= $this->cssID ?><?php if ($this->style): ?> style="<?= $this->style ?>"<?php endif; ?>>
<section<?= $this->attr($this->cssID)->addClass([$this->class, 'ce_accordion', 'block'])->addStyle($this->style) ?>>

<div class="<?= $this->toggler ?>"<?php if ($this->headlineStyle): ?> style="<?= $this->headlineStyle ?>"<?php endif; ?>>
<?= $this->headline ?>
Expand Down
2 changes: 1 addition & 1 deletion core-bundle/contao/templates/elements/ce_headline.html5
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

<<?= $this->hl ?> class="<?= $this->class ?>"<?= $this->cssID ?><?php if ($this->style): ?> style="<?= $this->style ?>"<?php endif; ?>>
<<?= $this->hl ?><?= $this->attr($this->cssID)->addClass($this->class)->addStyle($this->style) ?>>
<?= $this->headline ?>
</<?= $this->hl ?>>
2 changes: 1 addition & 1 deletion core-bundle/contao/templates/elements/ce_sliderStart.html5
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

<div class="<?= $this->class ?> block"<?= $this->cssID ?><?php if ($this->style): ?> style="<?= $this->style ?>"<?php endif; ?>>
<div<?= $this->attr($this->cssID)->addClass([$this->class, 'block'])->addStyle($this->style) ?>>

<?php if ($this->headline): ?>
<<?= $this->hl ?>><?= $this->headline ?></<?= $this->hl ?>>
Expand Down
2 changes: 1 addition & 1 deletion core-bundle/contao/templates/elements/ce_teaser.html5
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

<div class="<?= $this->class ?> ce_text block"<?= $this->cssID ?><?php if ($this->style): ?> style="<?= $this->style ?>"<?php endif; ?>>
<div<?= $this->attr($this->cssID)->addClass([$this->class, 'ce_text', 'block'])->addStyle($this->style) ?>>

<?php if ($this->headline): ?>
<h1><?= $this->headline ?></h1>
Expand Down
2 changes: 1 addition & 1 deletion core-bundle/contao/templates/elements/ce_toplink.html5
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

<!-- indexer::stop -->
<div class="<?= $this->class ?> block"<?= $this->cssID ?><?php if ($this->style): ?> style="<?= $this->style ?>"<?php endif; ?>>
<div<?= $this->attr($this->cssID)->addClass([$this->class, 'block'])->addStyle($this->style) ?>>
<a href="<?= $this->request ?>#top" title="<?= $this->title ?>"><?= $this->label ?></a>
</div>
<!-- indexer::continue -->
2 changes: 1 addition & 1 deletion core-bundle/contao/templates/forms/form_wrapper.html5
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

<!-- indexer::stop -->
<div class="<?= $this->class ?> block"<?= $this->cssID ?><?php if ($this->style): ?> style="<?= $this->style ?>"<?php endif; ?>>
<div<?= $this->attr($this->cssID)->addClass([$this->class, 'block'])->addStyle($this->style) ?>>

<?php if ($this->headline): ?>
<<?= $this->hl ?>><?= $this->headline ?></<?= $this->hl ?>>
Expand Down
2 changes: 1 addition & 1 deletion core-bundle/contao/templates/member/member_default.html5
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

<!-- indexer::stop -->
<div class="<?= $this->class ?> block"<?= $this->cssID ?><?php if ($this->style): ?> style="<?= $this->style ?>"<?php endif; ?>>
<div<?= $this->attr($this->cssID)->addClass([$this->class, 'block'])->addStyle($this->style) ?>>

<?php if ($this->headline): ?>
<<?= $this->hl ?>><?= $this->headline ?></<?= $this->hl ?>>
Expand Down
2 changes: 1 addition & 1 deletion core-bundle/contao/templates/member/member_grouped.html5
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

<!-- indexer::stop -->
<div class="<?= $this->class ?> block"<?= $this->cssID ?><?php if ($this->style): ?> style="<?= $this->style ?>"<?php endif; ?>>
<div<?= $this->attr($this->cssID)->addClass([$this->class, 'block'])->addStyle($this->style) ?>>

<?php if ($this->headline): ?>
<<?= $this->hl ?>><?= $this->headline ?></<?= $this->hl ?>>
Expand Down
4 changes: 2 additions & 2 deletions core-bundle/contao/templates/modules/mod_article.html5
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?php if ($this->teaserOnly): ?>

<?php $this->block('alias'); ?>
<article class="<?= $this->class ?> block"<?= $this->cssID ?><?php if ($this->style): ?> style="<?= $this->style ?>"<?php endif; ?>>
<article<?= $this->attr($this->cssID)->addClass([$this->class, 'block'])->addStyle($this->style) ?>>
<div class="ce_text block">
<h2><?= $this->headline ?></h2>
<div class="teaser">
Expand All @@ -21,7 +21,7 @@

<?php else: ?>

<div class="<?= $this->class ?> block"<?= $this->cssID ?><?php if ($this->style): ?> style="<?= $this->style ?>"<?php endif; ?>>
<div<?= $this->attr($this->cssID)->addClass([$this->class, 'block'])->addStyle($this->style) ?>>
<?php if ($this->printable): ?>
<?php $this->block('syndication'); ?>
<!-- indexer::stop -->
Expand Down
2 changes: 1 addition & 1 deletion core-bundle/contao/templates/modules/mod_articlenav.html5
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

<!-- indexer::stop -->
<div class="<?= $this->class ?> pagination block"<?= $this->cssID ?><?php if ($this->style): ?> style="<?= $this->style ?>"<?php endif; ?>>
<div<?= $this->attr($this->cssID)->addClass([$this->class, 'pagination', 'block'])->addStyle($this->style) ?>>

<?php if ($this->headline): ?>
<<?= $this->hl ?>><?= $this->headline ?></<?= $this->hl ?>>
Expand Down
2 changes: 1 addition & 1 deletion core-bundle/contao/templates/modules/mod_breadcrumb.html5
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

<!-- indexer::stop -->
<nav class="<?= $this->class ?> block"<?= $this->cssID ?><?php if ($this->style): ?> style="<?= $this->style ?>"<?php endif; ?> aria-label="Breadcrumb">
<nav<?= $this->attr($this->cssID)->addClass([$this->class, 'block'])->addStyle($this->style)->set('aria-label', 'Breadcrumb') ?>>

<?php $this->block('headline'); ?>
<?php if ($this->headline): ?>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

<!-- indexer::stop -->
<div class="<?= $this->class ?> block"<?= $this->cssID ?><?php if ($this->style): ?> style="<?= $this->style ?>"<?php endif; ?>>
<div<?= $this->attr($this->cssID)->addClass([$this->class, 'block'])->addStyle($this->style) ?>>

<?php if ($this->headline): ?>
<<?= $this->hl ?>><?= $this->headline ?></<?= $this->hl ?>>
Expand Down
2 changes: 1 addition & 1 deletion core-bundle/contao/templates/modules/mod_login.html5
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

<!-- indexer::stop -->
<div class="<?= $this->class ?> <?= $this->logout ? 'logout' : 'login' ?> block"<?= $this->cssID ?><?php if ($this->style): ?> style="<?= $this->style ?>"<?php endif; ?>>
<div<?= $this->attr($this->cssID)->addClass([$this->class, $this->logout ? 'logout' : 'login', 'block'])->addStyle($this->style) ?>>

<?php if ($this->headline): ?>
<<?= $this->hl ?>><?= $this->headline ?></<?= $this->hl ?>>
Expand Down
2 changes: 1 addition & 1 deletion core-bundle/contao/templates/modules/mod_navigation.html5
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

<!-- indexer::stop -->
<nav class="<?= $this->class ?> block"<?= $this->cssID ?><?php if ($this->style): ?> style="<?= $this->style ?>"<?php endif; ?>>
<nav<?= $this->attr($this->cssID)->addClass([$this->class, 'block'])->addStyle($this->style) ?>>

<?php if ($this->headline): ?>
<<?= $this->hl ?>><?= $this->headline ?></<?= $this->hl ?>>
Expand Down
2 changes: 1 addition & 1 deletion core-bundle/contao/templates/modules/mod_password.html5
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

<!-- indexer::stop -->
<div class="<?= $this->class ?> block"<?= $this->cssID ?><?php if ($this->style): ?> style="<?= $this->style ?>"<?php endif; ?>>
<div<?= $this->attr($this->cssID)->addClass([$this->class, 'block'])->addStyle($this->style) ?>>

<?php if ($this->headline): ?>
<<?= $this->hl ?>><?= $this->headline ?></<?= $this->hl ?>>
Expand Down
2 changes: 1 addition & 1 deletion core-bundle/contao/templates/modules/mod_two_factor.html5
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

<!-- indexer::stop -->
<div class="<?= $this->class ?> two-factor block"<?= $this->cssID ?><?php if ($this->style): ?> style="<?= $this->style ?>"<?php endif; ?>>
<div<?= $this->attr($this->cssID)->addClass([$this->class, 'two-factor', 'block'])->addStyle($this->style) ?>>

<?php if ($this->headline): ?>
<<?= $this->hl ?>><?= $this->headline ?></<?= $this->hl ?>>
Expand Down
2 changes: 1 addition & 1 deletion core-bundle/contao/templates/rss/rss_items_only.html5
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<?php $this->block('content'); ?>

<?php foreach ($this->items as $item): ?>
<div class="rss_items_only<?= $item['class'] ?>">
<div class="rss_items_only<?= $item['class'] ?? '' ?>">
<h2><a href="<?= $item['link'] ?>" target="_blank" rel="noreferrer noopener"><?= $item['title'] ?></a></h2>
<div class="description"><?= $item['description'] ?></div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion listing-bundle/contao/templates/info/info_default.html5
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

<div class="<?= $this->class ?> listing block"<?= $this->cssID ?><?php if ($this->style): ?> style="<?= $this->style ?>"<?php endif; ?>>
<div<?= $this->attr($this->cssID)->addClass([$this->class, 'listing', 'block'])->addStyle($this->style) ?>>

<?php if ($this->headline): ?>
<<?= $this->hl ?>><?= $this->headline ?></<?= $this->hl ?>>
Expand Down
2 changes: 1 addition & 1 deletion listing-bundle/contao/templates/listing/list_default.html5
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

<div class="<?= $this->class ?> ce_table listing block"<?= $this->cssID ?><?php if ($this->style): ?> style="<?= $this->style ?>"<?php endif; ?>>
<div<?= $this->attr($this->cssID)->addClass([$this->class, 'ce_table', 'listing', 'block'])->addStyle($this->style) ?>>

<?php if ($this->headline): ?>
<<?= $this->hl ?>><?= $this->headline ?></<?= $this->hl ?>>
Expand Down

0 comments on commit b8eaf2d

Please sign in to comment.