[SOLVED] Cb Fields with icons in the Contents Tab + image value from some fields

8 years 4 months ago - 8 years 4 months ago #275239 by bravostreet
Dear Joomlapolis, I'm trying to insert an icon image for some cb_fields inside the cbFieldsContentsTab (not in global description) like the attached simulated image but I cannot find a solution.

Could You find a solution please?


Second, I'd like associate for every value (from a Cb Field) an image, is is possible even?

Thanks
Attachments:

Please Log in to join the conversation.

8 years 4 months ago #275249 by krileon
That's next to the field title. You could use a language string for the field title like MY_FIELD_WITH_ICON then translate it as follows.

'MY_FIELD_WITH_ICON' => 'ICON_HTML_HERE My Field',

Another option is to add it to the fields value instead of the title. This is done using the Layout parameters within Parameters > Layout while editing the field. Specifically in Profile Value Layout you'd have the following for example

ICON_HTML_HERE [value]

Alternatively you can use CSS to do a :before on the fields title element and absolute position a background image there. This would give exactly what you illustrated, but requires CSS experience.

Second, I'd like associate for every value (from a Cb Field) an image, is is possible even?

Yup, that's doable. Best way is to use the Layout parameters described above and replace the value output with substitution IF usages. Example as follows.

[cb:if cb_myfield="1"]ICON_HTML_1[/cb:if]
[cb:if cb_myfield="2"]ICON_HTML_2[/cb:if]
[cb:if cb_myfield="3"]ICON_HTML_3[/cb:if]
[cb:if cb_myfield="4"]ICON_HTML_4[/cb:if]

It gets a bit more complicated if you're using a multiselect though.


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.
The following user(s) said Thank You: nant

Please Log in to join the conversation.

8 years 4 months ago #275319 by bravostreet
Thanks Kyle, that's perfect!
The following user(s) said Thank You: nant

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.165 seconds

Facebook Twitter LinkedIn