I have an entity with an entity reference to another entity that has a phone_number field. I am trying to display the formatted phone number in the first entity's template, but I can't seem to get the formatting.
Here is how I am accessing the phone number:
{{ content.field_entity_reference.entity.field_phone_number }}
This throws a Twig error.
I entered the phone number in this format +1 (ddd) ddd-dddd, which is how I would like to display the phone number, but I can't figure out how to get my formatting back out of the field.
field_phone_number.0 has these keys:
field_phone_number.0.value just returns +1dddddddddd, without any formatting.
So, what I am wondering is there an easy way to get the formatting at the theme layer? Do I need to use the phone_number.util service?
Closed: works as designed
1.0
Documentation
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.