drblitz/phone

Adds phone number functionality to TYPO3. Crate f.link.phone helper with the definition ITU-T INTERNATIONAL,NATIONAL,E123

Installs: 217

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

Type:typo3-cms-extension

dev-main 2024-01-23 21:37 UTC

This package is auto-updated.

Last update: 2024-04-18 22:05:26 UTC


README

What is it?

Adds phone number functionality to TYPO3 based on the Google's libphonenumber.

INTERNATIONAL and NATIONAL formats are consistent with the definition in ITU-T Recommendation E123. For example, the number of the DR BLITZ WEBLAB office will be written as "+48 12 333 44 01" in INTERNATIONAL format, and as "12 333 44 01" in NATIONAL format. E164 format is as per INTERNATIONAL format but with no formatting applied, e.g. "+48123334401". RFC3966 is as per INTERNATIONAL format, but with all spaces and other separating symbols replaced with a hyphen, and with any phone number extension appended with ";ext=". It also will have a prefix of "tel:" added, e.g. "tel:+48-12-333-44-01".

Installation

It is recommended to use composer to install the library.

$ composer require drblitz/phone

EXAMPLE

EXAMPLE 1 - NATIONAL format

{wb:link.phone(class:'contact-item__link',phoneNumber:data.tx_projectcore_phone, region:'pl', format: 2)}

return

<a class="contact-item__link" href="tel:+48-12-333-44-01">12 333 44 01</a>

EXAMPLE 2 - INTERNATIONAL format

{wb:link.phone(class:'contact-item__link',phoneNumber:data.tx_projectcore_phone, region:'pl', format: 1)}

return

<a class="contact-item__link" href="tel:+48-12-333-44-01">+48 12 333 44 01</a>

EXAMPLE 3 - E164 format

{wb:link.phone(class:'contact-item__link',phoneNumber:data.tx_projectcore_phone, region:'pl', format: 0)}

return

<a class="contact-item__link" href="tel:+48-12-333-44-01">+48123334401</a>

EXAMPLE 4 - Using ViewHelper with CE Textpic.

{wb:format.phone(value: data.bodytext, region:'de', format: 2)->f:format.html(parseFuncTSPath: 'lib.parseFunc')