Skip to content

Commit

Permalink
Feature: Disable links in footer, if not set
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikdro committed Feb 1, 2021
1 parent 28a69da commit 59bc8e6
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
prototype(KaufmannDigital.GDPR.CookieConsent:Component.Molecule.FooterLinks) < prototype(Neos.Fusion:Component) {
settingsNode = null

imprintLink = ${q(this.settingsNode).property('imprintLink')}
[email protected] = Neos.Neos:ConvertUris {
absolute = true
}

dataProtectionPolicyLink = ${q(this.settingsNode).property('dataProtectionPolicyLink')}
[email protected] = Neos.Neos:ConvertUris {
absolute = true
}

imprintLabel= ${q(this.settingsNode).property('imprintLabel')}
dataProtectionPolicyLabel = ${q(this.settingsNode).property('dataProtectionPolicyLabel')}

showImprint = ${this.imprintLink && this.imprintLabel}
showDataProtectionPolicy= ${this.dataProtectionPolicyLink && this.dataProtectionPolicyLabel}
showPipe = ${this.showImprint && this.showDataProtectionPolicy}

renderer = afx`
<div class="gdpr-cookieconsent-settings__content__links">
<a href={props.imprintLink} @if.condition={props.showImprint}>{props.imprintLabel}</a>
<span @if.condition={props.showPipe}> | </span>
<a href={props.dataProtectionPolicyLink} @if.condition={props.showDataProtectionPolicy}>{props.dataProtectionPolicyLabel}</a>
</div>
`
}
19 changes: 1 addition & 18 deletions Resources/Private/Fusion/Content/CookieSettings.fusion
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,13 @@ prototype(KaufmannDigital.GDPR.CookieConsent:Content.CookieSettings) < prototype
@cache.mode = 'embed'
}

imprintLink = ${q(node).property('imprintLink')}
[email protected] = Neos.Neos:ConvertUris {
absolute = true
}
dataProtectionPolicyLink = ${q(node).property('dataProtectionPolicyLink')}
[email protected] = Neos.Neos:ConvertUris {
absolute = true
}

hasNecessaryGroup = ${q(node).find('[instanceof KaufmannDigital.GDPR.CookieConsent:Content.NecessarySettingGroup]').count() > 0}

labels = Neos.Fusion:RawArray {
acceptAll = ${q(node).property('acceptAllButtonLabel')}
save = ${q(node).property('saveButtonLabel')}
saveButtonLabel = ${q(node).property('saveButtonLabel')}
acceptNecessaryCookiesLabel = ${q(node).property('acceptNecessaryCookiesLabel')}
imprintLabel= ${q(node).property('imprintLabel')}
dataProtectionPolicyLabel = ${q(node).property('dataProtectionPolicyLabel')}
openIndividualSettingsLabel = ${q(node).property('openIndividualSettingsLabel')}
closeIndividualSettingsLabel = ${q(node).property('closeIndividualSettingsLabel')}
}
Expand All @@ -60,13 +49,7 @@ prototype(KaufmannDigital.GDPR.CookieConsent:Content.CookieSettings) < prototype
<div class="gdpr-cookieconsent-settings__content__settings">
{props.individualSettings}
</div>

<div class="gdpr-cookieconsent-settings__content__links">
<a href={props.imprintLink}>{props.labels.imprintLabel}</a>
<span> | </span>
<a href={props.dataProtectionPolicyLink}>{props.labels.dataProtectionPolicyLabel}</a>
</div>

<KaufmannDigital.GDPR.CookieConsent:Component.Molecule.FooterLinks settingsNode={node} />
<div class="gdpr-cookieconsent-settings__content__individual-switch">
<a id="gdpr-cc-btn-individual-settings-enable">{props.labels.openIndividualSettingsLabel}</a>
<a id="gdpr-cc-btn-individual-settings-disable">{props.labels.closeIndividualSettingsLabel}</a>
Expand Down

0 comments on commit 59bc8e6

Please sign in to comment.