Skip Navigation

[Closed] When trying to insert the "Toolset" field into the A tag, the URL is not output

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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 8 replies, has 3 voices.

Last updated by Minesh 1 year, 11 months ago.

Assisted by: Minesh.

Author
Posts
#2645611

When trying to insert the "Toolset" field into the A tag, the URL is not output

As shown below, in the original WordPress theme written in php, if you try to insert the "Toolset" field into the A tag, the URL will not be output, but a blank space will be output.

PHP source code
<?php if(types_render_field("wpcf-upload-pdf-01")): ?>
<section class="box">
<h3>Title</h3>
<p>Anchor Text " target="_blank">

Output HTML
anchor text

Please let me know if there is anything I should fix in the Toolset settings.

#2645699

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Hi there

A note a couple of potential problems.

href="<?php echo(types_render_field("wpcf-upload-pdf-01", array())); ?>" 

Could you try using single quotes for the type_render_field argument (given that it is already within double quotes).

And when using types_render_field, you use the custom field slug, not the post meta key (which includes the 'wpcf-' prefix).

So try

href="<?php echo(types_render_field('upload-pdf-01', array() )); ?>" 
#2645877
スクリーンショット 2023-09-21 11.52.32.png
スクリーンショット 2023-09-21 11.45.23.png

Hi, Nigel. Thank you for your quick reply.

1. I Revised to single quotes for the type_render_field argument. But doesn't work...
2. Since Updated plugin, Field slug is changed to "wpcf-upload-pdf-01" including the 'wpcf-' prefix. I don't know the reason.

The page in question is below
hidden link

Maybe it's not a blobrem about "toolset"

Regards,

#2645913

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

1. I Revised to single quotes for the type_render_field argument. But doesn't work...
====>
Can you please try to use the following:

href="<?php echo(types_render_field('upload-pdf-01', array('output'=>'raw') )); ?>"

Does that helps?

2. Since Updated plugin, Field slug is changed to "wpcf-upload-pdf-01" including the 'wpcf-' prefix. I don't know the reason.
====>
Toolset store the custom field value with "wpcf-" prefix since Types first version. So this is known and there is nothing new.

#2645927

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

From your screenshot showing the raw custom field values in the editor it appears something is going wrong, with multiple wpcf- prefixes being added.

How are you adding content? I would not expect to see this if you were adding/editing content in the normal WordPress editor or submitting content via Toolset Forms, unless you are also using some custom code that is interfering in the normal process.

You are using PHP code for the templates outputting the data, are you also using any code when the data is being input?

#2646391

Hi Minesh

Thank you for your advice.

1. I tried the code you suggest, but the content of the A tag remains blank as "".
2. I understood about attaching prefix.

#2646395

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

You will have to share with me problem URL where I can see the anchor tag on frontend as well as admin access details and also share the information where you have added the code types_render_field().

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2646397

Hi Nigel
I was also concerned about the issue of multiple prefixes.
Files used in custom fields are uploaded from the fixed page editing screen.

Hi, Minesh
Please wait while we confirm with the client regarding sharing account information.

#2646545

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Please share admin access details when you can and lets address the issues one by one.

We will try to address the file issue you raised with this ticket first.

I have set the next reply to private which means only you and I have access to it.

The topic ‘[Closed] When trying to insert the "Toolset" field into the A tag, the URL is not output’ is closed to new replies.