Adding icons to selections

4 posts by 2 authors in: Forums > CMS Builder
Last Post: July 20, 2018   (RSS)

By willydoit - July 19, 2018

Hi all,

not sure if this is possible but perhaps someone can tell me if it is.

I have a table consisting of local accommodation providers.  I have a list of tickboxes that they can select to show the facilities they provide such as disabled access, credit cards accepted etc.  What I would like to be able to do is associate tiny images to these options so that the services provided can be displayed as graphical representations when displayed on listing and detail pages as is often done for accommodation listings.  Would this be achievable using cmsb?

Thanks in advance for your help.

By willydoit - July 20, 2018

Hi Leo,

The main priority is to have them shown on the front end if possible both would be great but the priority is so that visitors to the website can see services provided at a glance, something like the attached image but maybe having the option to just display the images on their own.

Attachments:

facilities.jpg 17K

By leo - July 20, 2018

Hi,

If that's the case you can do it by modifying the checkbox input to include the icon image. For example, if a checkbox looks like this:

<input type="checkbox" id="example" name="example" value="1" />
<label for="example">Example</label>

You can include the icon by:

<input type="checkbox" id="example" name="example" value="1" />
<label for="example"><img src="path/to/image" /></label>

However, if you want it to have it like your example as the checkbox is hidden, you will have to use javascript/jQuery to create a similar experience.

Let me know if you have any questions.

Thanks,

Leo - PHP Programmer (in training)
interactivetools.com