Skip Navigation

[Gelöst] show_name="true" / output="html" doesn't work

This support ticket is created vor 6 Jahren, 6 Monaten. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

Dieses Thema enthält 8 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von Luo Yang vor 6 Jahren, 6 Monaten.

Assistiert von: Luo Yang.

Author
Artikel
#910841

I am trying to: show the label of the field / link the phone number

Link to a page where the issue can be seen: versteckter Link

I expected to see: label / linked phone number

Instead, I got: no label / just plain text

Here are the shortcodes i use (inside a text box):

[wpv-post-title]
[types field="position" show_name="true"][/types]
[types field="telefon" output="html" show_name="true"][/types]
[types field="mobil" show_name="true"][/types]
[types field="e-mail" show_name="true"][/types]

#910912

Hello,

I assume we are talking about a custom phone field created with Types plugin:
https://toolset.com/documentation/customizing-sites-using-php/functions/#phone

There isn't attribute "show_name" or "output", so you will need to add the field label manually, for example:
Telefon: [types field="telefon" output="html" show_name="true"][/types]

#910958

Hi, thanks for reply and help!

[wpv-if telefon="wpcf-telefon" evaluate="!empty($telefon)"]Telefon: [types field="telefon"][/types][/wpv-if]

The label doesn't work in this case... and also the spaces should be removed in the href (my client want's to display the phone number with spaces!).

#910970

Just found the problem...

if i save this line:

[wpv-if telefon="wpcf-telefon" evaluate="!empty($telefon)"]Telefon: [types field="telefon"][/types][/wpv-if]

it works. If i reopen the text field and save again, it changes the line to:

[wpv-if telefon="wpcf-telefon" evaluate="!empty($telefon)"]Telefon: [types field="telefon"][/types][/wpv-if]

Maybe a bug?

Still need to remove the spaces in href attribute...

#910973

Please try to use single quotes in the Types shortcode, like this:

<a href="tel:[types field='telefon'][/types]">Telefon: [types field="telefon"][/types]</a>

See the live demo here:
versteckter Link
user/pass: xgren/111111

Content template URL:
versteckter Link

#910992

Thank you for your fast and straight forward support! I suppose the problem with the spaces in the href attribute could not be solved?

#911004

Please elaborate the new question with more details:
I suppose the problem with the spaces in the href attribute could not be solved?

You can duplicate the same problem in above test site, thanks

#911010

The client wants to output the phone number in this format:

+43 5372 67892 (with spaces between country and area and phone number)

This results in a link like:

+43 5372 67892 (also with spaces in the href attribute)

As far as i know, there should be no spaces within the href attribute. It should look like:

+43 5372 67892 (no spaces in href / spaces in text)

Example: versteckter Link

#911018

There isn't such a feature to remove the space in phone field value.
I just test the URL in my android phone and Skype soft ware, it can be called without any problem, I don't think you need to remove the space.