CB Drop down field with thumbnails

6 years 6 months ago #298120 by activha
CB Drop down field with thumbnails was created by activha
Hi

I would like to use CB Dropdown field with html displaying thumbnails for labels instead of plain texts

If we try to input html in the label fields, this is erased at saving of the field.

Can you give me a hint at how to achieve this ?

Thanks
Jean

Please Log in to join the conversation.

6 years 6 months ago #298126 by krileon
Replied by krileon on topic CB Drop down field with thumbnails
For the dropdown you can't put HTML in the labels directly. That's not within HTML spec for select inputs. You'd have to use IF substitution in the profile layout value to condition HTML to be output. Example as follows.

Value: value1
Label: Value 1

Profile Value Layout:
[cb:if cb_field="value1"]<strong>Value 1!</strong>
[cb:else][value][/cb:else]
[/cb:if]


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.

6 years 6 months ago #298130 by activha
Replied by activha on topic CB Drop down field with thumbnails
OK does it have to be nested or should I write
[cb:if cb_field="value1"]<strong>Value 1!</strong>
[cb:else][value][/cb:else]
[/cb:if]
[cb:if cb_field="value2"]<strong>Value 2!</strong>
[cb:else][value][/cb:else]
[/cb:if]
[cb:if cb_field="value3"]<strong>Value 3!</strong>
[cb:else][value][/cb:else]
[/cb:if]
]

And will it work with image display in the dropdown list ?

Please Log in to join the conversation.

6 years 6 months ago #298133 by krileon
Replied by krileon on topic CB Drop down field with thumbnails
No, that's for profile display only. If you want images actually in the dropdown you need a jQuery driven dropdown like jQuery Select2 or Chosen. You can convert a CB select field to select2 using our built in CB Select jQuery plugin using CB Auto Actions as shown below.

www.joomlapolis.com/forum/153-professional-member-support/236285-substring-search-in-cb-query-field-how-to-get-this-method#292473

However, you likely won't be able to use conditions from CB Conditional on that select field anymore. As for adding the HTML to the label you won't be able to directly. You'll have to use a language string then have the HTML in the language translation for that string.


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.216 seconds

Facebook Twitter LinkedIn