Skip Navigation

[Resolved] Showing Icon when Using Checkbox

This support ticket is created 4 years, 4 months 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.

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 6 replies, has 2 voices.

Last updated by Minesh 4 years, 4 months ago.

Assisted by: Minesh.

Author
Posts
#1881905
Screen Shot 2020-12-20 at 1.03.14 PM.png
Screen Shot 2020-12-20 at 1.03.06 PM.png

Hello,
I've created a post type that is using the checkbox custom field (hidden link). I wanted to know if an icon shows up when an option is checked (hidden link).

Here's the URL to my site - hidden link, but the custom post type isn't live yet. Let me know if you need access to by backend.

#1882491

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

As I understand, you would like to display different icons per checkboxes field option.

Types offers how you can display content for checked/unchecked options. For example:

[types field="your-checkboxes-field-slug" option="0" state="checked"]
Display your image here for option 0 when checked
[/types]

[types field="your-checkboxes-field-slug" option="1" state="checked"]
Display your image here for option 1 when checked
[/types]

Replace your "your-checkboxes-field-slug" with your original field slug.

More info:
=> https://toolset.com/documentation/customizing-sites-using-php/functions/#checkboxes

#1882649

Okay,
I added the code using Toolset and it's now showing the checkbox value "mcdaa", here's the URL - hidden link

Here's the block code so you can review it -

<p><strong>[types field='grad-class'][/types]<strong> | [types field='high-school'][/types] | </strong><span id="tb-shortcode-269" class="tb-fields-and-text-shortcode-render tb-fields-and-text-shortcode-render-types tb-shortcode-selected" data-tb-shortcode-id="269" data-tb-shortcode-is-block="false"><strong><!-- TBINNERSTART 269 -->Wake Forest</strong><!-- TBINNEREND 269 --></span></strong></p>

<p>[types field='accolades' state="checked" option="0"]<em><u>hidden link</u></em>;

[types field='accolades' state="checked" option="1"]<em><u>hidden link</u></em>;

[types field='accolades' state="checked" option="2"]<em><u>hidden link</u></em>;

[types field='accolades' state="checked" option="3"]<em><u>hidden link</u></em>;

[types field='accolades' state="checked" option="4"]<em><u>hidden link</u></em>;

[types field='accolades' state="checked" option="5"]<em><u>hidden link</u></em>;

Also, how do you change this to a table view. I didn't see it in the loop options in the sidebar?

Let me know if you want access to my backend to see what's going on.

Thanks in advance for your help with this

#1882651

Minesh
Supporter

Languages: English (English )

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

Can you please share what image you want to display with what option and share access details so I can check whats going on with your setup.

*** 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.

#1882731

Minesh
Supporter

Languages: English (English )

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

I'm not sure whats going on with your site as it just not display the checkboxes option values when checked.

I tried using single field block as well as by creating a content template that holds the shortcodes:
=> hidden link

And then I've added the content template to your block view's loop:
=> hidden link

But its not working.

Then, I've run a test with my test site by creating the checkboxes field and set this field to display with 'Student Review" CPT:
=> hidden link

Then, I've created the block view:
=> hidden link

And try to add the checkboxes field using single field block as well as using content template:
=> hidden link

But when I see the result on frontend:
=> hidden link

I see it displays the correct output using Single field as well as using content template added using view.

You can login to my test site using:
User: demo
pwd: Admin@999

As the same thing is not working on your site, I suggest you should create a staging site and perform basic debug steps:
- Could you please try to resolve your issue by deactivating all third-party plugins as well as the default theme to check for any possible conflicts with any of the plugins or themes? Do you see any different?
- Please check with clean install where you create a checkboxes field and try to display it's associated values.
- What if you create another test post type and custom checkboxes field and try to create a view that display the posts belongs to this test post type to ensure that view you created is not corrupted?

#1882905

Hello Support,
I actually got it to work. hidden link
The issue was the <img src=""> tag was missing. Once I add that it worked just fine... WHEW!!!

Last question, I want to change this view to the table view. But I noticed that option isn't available in the Loop Section - hidden link

Can this still be done.. .Thanks

#1883399

Minesh
Supporter

Languages: English (English )

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

Great. However the site you shared is different than on what I run a test which is cyfairelitebasketball.info

Glad to know that your original issue is resolved.

With block view, there is no table based loop layout available but its on our records and we will try to add this feature as soon as possible.