[Resolved] How to replace text with an image in a filter

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.

This topic contains 1 reply, has 2 voices.

Last updated by Shane 3 years ago.

Assigned support staff: Shane.

Author
Posts
#499198

I want to add logos for products instead of text in a View Output. I have built the following table:

hidden link

The filter works correctly. It filters by yoga practice. My client asked if the text in the 3rd column of the table could be changed so the practiced displayed an image instead of text. The issue is that the text is the filter value that is used in the filter above the table.

Is this possible with views? Can I have text in the filter above the table, but the values in the table be an image?

Here is my Filter:

[wpv-filter-start hide="false"]
[wpv-filter-controls]

[wpml-string context="wpv-views"]City / State:[/wpml-string] [wpv-control field="city-state" url_param="city-state"]
[wpml-string context="wpv-views"]Practices:[/wpml-string] [wpv-control field="practices" url_param="practices" type="select" values=",Project Mantra,Babaji Surya Namaskar,Atma Kriya Yoga,Simply Meditation" display_values="All Sadhanas,Project Mantra,Babaji Surya Namaskar,Atma Kriya Yoga,Simply Meditation"]
[wpv-filter-spinner container="div" position="before" spinner="hidden link"][/wpv-filter-spinner]

[/wpv-filter-controls]
[wpv-filter-end]

Here is my View:

[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<table class="table table-responsive">
<thead>
<tr>
<th></th>
<th>[wpv-heading name="types-field-full-name"]Full Name[/wpv-heading]</th>
<th>[wpv-heading name="types-field-city-state"]City / State[/wpv-heading]</th>
<th>[wpv-heading name="types-field-practices"]Practices[/wpv-heading]</th>
<th>[wpv-heading name="types-field-email"]Contact[/wpv-heading]</th>
<th>[wpv-heading name="types-field-languages"]Languages[/wpv-heading]</th>
<th>[wpv-heading name="types-field-travel"]Travels?[/wpv-heading]</th>
</tr>
</thead>
<tbody class="wpv-loop js-wpv-loop">
<wpv-loop>
<tr>
<td>[types field='teacher-photo' alt='Teacher Profile Photo' width='72' height='72' align='none' resize='proportional'][/types]</td>
<td>[types field='full-name'][/types]</td>
<td>[types field='city-state'][/types]</td>
<td>[types field='practices' separator=', '][/types]</td>
<td>
[types field='email'][/types]
[wpv-conditional if="( $(wpcf-phone) ne '' )"]<br/>[types field='phone'][/types][/wpv-conditional]
[wpv-conditional if="( $(wpcf-facebook-profile) ne '' )"]<br/><a href="[types field='facebook-profile' output='raw'][/types]" target="_blank">Facebook</a>[/wpv-conditional]
</td>
<td>[types field='languages'][/types]</td>
<td>[types field='travel' separator=', '][/types]</td>
</tr>
</wpv-loop>
</tbody>
</table>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
<div class="alert alert-info">[wpml-string context="wpv-views"]No results. Try to change your search.[/wpml-string]</div>
[/wpv-no-items-found]
[wpv-layout-end]

#499411

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Seb,

Thank you for contacting our support forum.

Unfortunately this isn't possible as our filters do not support images for options. Any means of doing this would require some amount of custom coding which is out of our scope as forum support .

Thanks,
Shane