Skip to content

Commit

Permalink
Merge pull request #21 from contao-themes-net/add-link-title-c4
Browse files Browse the repository at this point in the history
Add link title field to feature element (contao 4)
  • Loading branch information
MDevster authored Apr 30, 2024
2 parents 145b752 + 21c6c2a commit 52faf6a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ Types of changes
Security in case of vulnerabilities.
)

## [1.3.17](https://github.com/contao-themes-net/theme-components-bundle/tree/1.3.17) – 2024-04-30

- [Added] Add link title field to feature element

## [1.3.16](https://github.com/contao-themes-net/theme-components-bundle/tree/1.3.16) – 2024-02-26

- [Added] Add subheadline
Expand Down
4 changes: 4 additions & 0 deletions src/Element/FeatureElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ protected function compile(): void
$this->Template->rel = '';
$this->Template->text = StringUtil::encodeEmail((string) $this->text);

if ($this->titleText) {
$this->Template->linkTitle = StringUtil::specialchars($this->titleText);
}

// Overwrite template
if ('' !== $this->ct_featureElement_customTpl) {
$this->Template->setName($this->ct_featureElement_customTpl);
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/contao/dca/tl_content.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
;

$GLOBALS['TL_DCA']['tl_content']['palettes']['ct_contentBox'] = '{type_legend},type,headline,subline,headline_inline,subheadline;{text_legend},text;{ct_contentBox_settings},ct_contentBox_page,target,ct_contentBox_pageText,ct_contentBox_pageTitle;{template_legend:hide},ct_contentBox_customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID;{advanced_classes_legend},advancedCss;{invisible_legend:hide},invisible,start,stop;';
$GLOBALS['TL_DCA']['tl_content']['palettes']['ct_featureElement'] = '{type_legend},type,headline;{text_legend},text,ct_featureIcon,ct_iconLink,target;{template_legend:hide},ct_featureElement_customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID;{advanced_classes_legend},advancedCss;{invisible_legend:hide},invisible,start,stop;';
$GLOBALS['TL_DCA']['tl_content']['palettes']['ct_featureElement'] = '{type_legend},type,headline;{text_legend},text,ct_featureIcon,ct_iconLink,target,titleText;{template_legend:hide},ct_featureElement_customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID;{advanced_classes_legend},advancedCss;{invisible_legend:hide},invisible,start,stop;';
$GLOBALS['TL_DCA']['tl_content']['palettes']['ct_priceBox'] = '{type_legend},type,headline;{text_legend},text,ct_price,ct_priceLabel,ct_priceBox_link1,ct_priceBox_linkText1,ct_priceBox_link2,ct_priceBox_linkText2,ct_popularPriceBox;{template_legend:hide},ct_priceBox_customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID;{advanced_classes_legend},advancedCss;{invisible_legend:hide},invisible,start,stop';
$GLOBALS['TL_DCA']['tl_content']['palettes']['ct_teaserBox'] = '{type_legend},type,headline,subline,headline_inline,subheadline;{text_legend},text;{ct_teaserBox_settings},ct_teaserBox_page,target,ct_teaserBox_pageText,ct_teaserBox_pageTitle;{image_legend},addImage;{template_legend:hide},ct_teaserBox_customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID;{advanced_classes_legend},advancedCss;{invisible_legend:hide},invisible,start,stop;';
$GLOBALS['TL_DCA']['tl_content']['palettes']['ct_wrapperStart'] = '{type_legend},type,ct_wrapper_name;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID;{advanced_classes_legend},advancedCss;{invisible_legend:hide},invisible,start,stop';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<?php if($this->featureIcon != ""): ?>
<div class="icon">
<?php if($this->iconLink != ""): ?><a href="<?= $this->iconLink ?>"<?= $this->target ?><?= $this->rel ?>><?php endif; ?>
<?php if($this->iconLink != ""): ?><a href="<?= $this->iconLink ?>"<?php if ($this->linkTitle): ?> title="<?= $this->linkTitle ?>"<?php endif; ?><?= $this->target ?><?= $this->rel ?>><?php endif; ?>
<i class="<?= $this->featureIcon ?>"></i>
<?php if($this->iconLink != ""): ?></a><?php endif; ?>
</div>
Expand Down

0 comments on commit 52faf6a

Please sign in to comment.