[SOLVED] How to add image to checkbox

13 years 6 months ago #142919 by memochipan
[SOLVED] How to add image to checkbox was created by memochipan
Hi, this is my first post.

I need a checkbox field with images. How can i do this?

The idea is that my users can pick an image that they like.:P

Thanks for help.

Post edited by: krileon, at: 2010/10/08 21:38

Please Log in to join the conversation.

13 years 6 months ago #142929 by memochipan
Replied by memochipan on topic Re:How to add image to checkbox
I used the image tag in the options, and the images are displayed, but no value is saved in the MySQL table.

Any suggestion.

Thanks.
Attachments:

Please Log in to join the conversation.

13 years 6 months ago #142992 by memochipan
Replied by memochipan on topic Re:How to add image to checkbox
Nobody can help?

Please Log in to join the conversation.

13 years 6 months ago #143003 by krileon
Replied by krileon on topic Re:How to add image to checkbox
Images are not supported for select fieldtypes. The values will be cleaned before store/display. You should create a new fieldtype plugin to handle this or use a drop-down select in combination of substitutions in a delimiter to display the images. I also recommend upgrading to CB 1.2.3, you posted in CB 1.2.2 boards.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

13 years 6 months ago #143401 by memochipan
Replied by memochipan on topic Re:How to add image to checkbox
Thanks krileon.

I tried to create a new fieldtype plugin but I don't understand all that I need to do that, and I didn't find documentation about the process other than analyze existing plugins.

I think that create a fieldtype plugin is a very good idea, because it can be reuse in other cases.

Could you help me a little bit in that process?

Could you explain me what are you talking about when you said:

or use a drop-down select in combination of substitutions in a delimiter to display the images.


Again, thanks a lot.

Please Log in to join the conversation.

13 years 6 months ago #143408 by krileon
Replied by krileon on topic Re:How to add image to checkbox
You could have a drop-down field with the following values. Lets call this field color so is stored as cb_color.

red
blue
green

Then using substitutions you could do the following in a delimiter field.

[code:1]
[cb:if cb_color!=""]<img src="/images/[cb_color].png" alt="[cb_color]" />[/cb:if]
[/code:1]

Then within the images folder you'd have the following images.

red.png
blue.png
green.png

This is just a minor example of what's possible. Please review tutorials within my signature for substitution usage information.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.510 seconds

Facebook Twitter LinkedIn