Skip Navigation

[Resolved] Can't Change Separator Using Types API for Repeating Checkbox

This thread is resolved. Here is a description of the problem and solution.

Problem:
Separator not being displayed properly.

Solution:
Do not use output argument in types_render_field. The proper way should be:

types_render_field( "facility-offerings", array("separator" => "") );
This support ticket is created 8 years, 1 month ago. 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 8:00 – 17:00 8:00 – 17:00 8:00 – 17:00 8:00 – 17:00 8:00 – 17:00 -
- - - - - - -

Supporter timezone: America/Sao_Paulo (GMT-03:00)

Tagged: 

This topic contains 9 replies, has 3 voices.

Last updated by vinceA 8 years, 1 month ago.

Assisted by: Adriano.

Author
Posts
#372637

I have a custom field with the slug 'facility-offerings'. The checkbox values contain html like this:

<div class="column"><i class="fa fa-circle-thin fa-2x"></i><br />Information Not Available<br /><br /></div>

Using the types API I am using:

types_render_field( 'facility-offerings', array('output'=>'raw','separator'=>';') );

On the front end, the html displays OK, but no matter what I set the 'separator value to, it displays commas. In other words the separator setting is NOT working no matter what.

I've tried many ways, removing it and no luck.

#372730

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Vince,

Thank you for contacting our support forum.

This is just a response to let you know that i've seen your ticket and will be handled as soon as I am able to.

Thanks,
Shane

#373045

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Vince,

Thank you for contacting our support forum.

I was able to replicate this issue and have reported it to our development team.

Hopefully there will be a fix for this soon.

Thanks,
Shane

#373623

Thanks for following up.

What is the ETA for this fix?

I expect the fix very soon as it is a core API function and influences a visitor facing aspect of my website.

#374054

Hello,

Please check today's release. I couldn't reproduce the issue in Types 1.9.1.

#374113

Using 1.9.1 I still have the issue.

#374341

I need to request temporary access (wp-admin and FTP) to your site in order to be offering better help. You will find the needed fields for this below the comment area when you log in to leave your next reply. The information you will enter is private which means only you and I can see and have access to it.

#375118

Adriano,

I absolutely will not provide access to my public facing site. You will be able to replicate the issue with the information I provide below:

The field is a Checkboxes field. Two fields for you to use in testing:

Title: Not Available
Value to Store: <div class="column"><i class="fa fa-circle-thin fa-2x"><br />Information Not Available<br /><br /></div>

Title: Bar
Value to Store: <div class="column"><i class="fa fa-glass fa-2x"> <br />Bar<br /><br /></div>

Then in my php file for rendering a single post of that custom post type this code is used:

$facilityofferings = types_render_field( "facility-offerings", array("output"=>"raw","separator" => "") );

<?php echo $facilityofferings; ?>

No matter what I put in the separator field, it always displays a comma between each output.

#375444
Captura de Tela 2016-03-14 às 11.01.54.png
Captura de Tela 2016-03-14 às 11.01.47.png
Captura de Tela 2016-03-14 às 11.01.27.png
Captura de Tela 2016-03-14 às 11.00.58.png

Hello,

I've run the following permutations and the results can be viewed attached:

echo types_render_field( 'checkbox-test',array( "separator" => " : " ) );
echo types_render_field( 'checkbox-test',array( "separator" => " :) " ) );
echo types_render_field( 'checkbox-test',array( "separator" => " - " ) );

Try to update your Types to 1.9.1.

#375566

I am on 1.9.1

The test details I provided and what you tested are two different things.

I've found the issue. This works:

types_render_field( "facility-offerings", array("separator" => "") );

This doesn't:

types_render_field( "facility-offerings", array("output"=>"raw","separator" => "") );
This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.