DC fields in Telephone URL

When trying to use a DC field to set the URL of an element with the “tel” type, it doesn’t work properly, requiring it to be done via the regular “url” type and manually setting the url as tel:{{dc:acf:option_field field=“field_name”}}

I think this was the case prior to the beta being released so I don’t think it’s a beta specific issue.

@spedney, thanks for writing in! Yes, this isn’t quite in the scope of the beta, but I have noted it down. I don’t have ACF up in my install at the moment, but when I test with any other piece of Dynamic Content, I am getting the tel: prefix before anything I put in, so this seems to be working as expected. Is the ACF field you’re pulling through just a string from the backend? Wondering if it’s some sort of type issue there, because any other DC I use outputs a “proper” string with the tel: prefix followed by the Dynamic Content.

Thanks!

I’ll try to explain a bit more… I don’t know if this will help. it is an ACF text field…

I just tested again by entering this in the “tel” type field:
{{dc:post:meta post="84" key="telefon"}}
The resulting link looks comes out just as “tel:” even though in the “preview” section it seems ok. See screenshot:
Screenshot 2022-10-07 at 21.00.30

If I then click on the “link” icon, is see this has now appeared there:
tel:%7B%7Bdc:post:meta%20post=%2284%22%20key=%22telefon%22%7D%7D
Screenshot 2022-10-07 at 21.00.38

If I then delete what’s in the “link” field and enter:
tel:{{dc:post:meta post="84" key="telefon"}}
it works just fine
Screenshot 2022-10-07 at 21.02.18

@spedney, I think I see what’s happening here. As for the formatting that appears when you switch from a “telephone” link to a “standard” link, this is expected as the input takes whatever has been provided and sanitizes it / automatically prefixes it with tel: as a graceful fallback.

Additionally, the “preview” is correct, too, as it does not parse dynamic content within that input, so just seeing the DC string repeated is correct.

However, what I am seeing is that if I just do something like {{dc:global:date format="YYY"}} in the telephone input to simulate pulling through some numbers from Dynamic Content, what I should see in that case is tel:202220222022 when I hover over my Button in the live preview, but instead I see tel:October 7, 2022. However, if I go to the standard link input and manually write in tel:{{dc:global:date format="YYY"}}, I do see tel:202220222022 outputting as expected. My thought here is that something is off with the parsing of arguments in Dynamic Content, which is why the formatting is being ignored in the telephone input and respected in the base input.

As you mentioned, this is somewhat outside the scope of this release, but I have put a note together on this in our issue tracker to be looked into. For now, you can certainly manually write in any Dynamic Content links using the standard input and prefixing them with tel: as needed.

Thanks!