We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Find and Replace : Text for Images

Development and Programming

journalistone's avatar
journalistone
78 posts
15 years ago
journalistone's avatar journalistone

Hello,

I am looking for a method to produce a similar result as the Find and Replace Plugin, but replace with image.

For example, I have a table listing a product’s features, and I would like to replace the word ‘yes’ with a ‘tick’ image… and similarly ‘no’, with a ‘cross’ image.

Does anyone know of a plugin or extension that may do this ?

       
smartpill's avatar
smartpill
456 posts
15 years ago
smartpill's avatar smartpill

You can just use conditionals like if your custom field was named “get_pix”…

{if get_pix == "yes"}{tick.jpg{if:elseif get_pix =="no"}cross.jpg{/if}
       
journalistone's avatar
journalistone
78 posts
15 years ago
journalistone's avatar journalistone

Thanks smartpill. This is perfect advice… 😊

As I am working with a multi-lingual site, my if conditionals were getting rather long so I ended up doing a similar method where I created an image based on the image custom_field

{custom_image_field}.png

.

As always, I was thinking way to hard, and not laterally enough, so thank you for your support 😊

       
smartpill's avatar
smartpill
456 posts
15 years ago
smartpill's avatar smartpill
Thanks smartpill. This is perfect advice… 😊 As I am working with a multi-lingual site, my if conditionals were getting rather long so I ended up doing a similar method where I created an image based on the image custom_field
{custom_image_field}.png
. As always, I was thinking way to hard, and not laterally enough, so thank you for your support 😊

No problem, we’ve all been there 😉 . That’s a good, clean solution too as long as the field is never blank.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.