Skip to content

Commit

Permalink
✨ Add option to set prepend in Carbon.Link:Telephone
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnitto authored Aug 11, 2020
1 parent c5e2d3b commit f9cb12e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Resources/Private/Fusion/Link/Telphone.fusion
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
prototype(Carbon.Link:Telephone) < prototype(Neos.Fusion:Value) {
defaultCountryCode = ${Configuration.setting('Carbon.Link.defaultPhoneCountryCode')}
prepend = 'tel:'

value = ${value}
value.@process {
replacePlusWidth00 = ${String.replace(value, '+', '00')}
removeSpaces = ${String.pregReplace(value, '/\s/', '')}
removeZerosInBrackets = ${String.replace(value, '(0)', '')}
makeLocalNumberInternational = ${this.defaultCountryCode ? String.pregReplace(value, '/^0([1-9])/', this.defaultCountryCode + '$1') : value}
prependTelProtocol = ${value ? 'tel:' + value : value}
prependTelProtocol = ${value && props.prepend ? props.prepend + value : value}
}
}

0 comments on commit f9cb12e

Please sign in to comment.