Concatenate Fields with IF statement

  • kenryanjr
  • Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
  • Posts: 144
  • Thank you received: 0

kenryanjr created the topic: Concatenate Fields with IF statement

I have two fields I would like to concatenate into one.

The first is the column that the data belongs to
<?php $col2170 = 'col2170';$value = '<span class="fa fa-camera">&nbsp;</span>' . $value; ?>

The second field is another column that I would like to have the if statement.
<?php if (empty($value)) { $value='<img src="images/noImage.jpg" alt="No Image Available" class="img-forsale"/>'; } else { $value='<img src="images/forsale/vehicles/'.$value.'"  alt="Photo of Item For Sale" class="img-forsale" />'; } ?>

Problem is I am not calling the col1516 in this statement and having a hard time getting this to work. Can someone help me.
  • Posts: 2652
  • Karma: 92
  • Thank you received: 354

mihaela replied the topic: Concatenate Fields with IF statement


If you wish to display an image in a list view you need to use the Image Scale plugin for that.

Setting it the way that you have tried with the if statement won't work.

You just need to put the following code in the "item Wrap Column":
${CBImageScale width: 20px;}

This way images will be displayed if uploaded. If not, no image will appear.

Let me know whether that solution is ok for you.


Moderators: ForumSupporttomeperica
Time to create page: 0.053 seconds

New Icon Packs Category!

Crosstec is now offering icon packs.

If you are a paying subscriber, icon packs are automatically added to your account.

Check out our icon packs page!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Summer Sale!

50% discount on all of our extension subscription plans, templates and icon packs!

Get Your Subscription Here

News and Updates

Get informed about new downloads, updates and more in our News and Updates newsletter.

All Extensions Subscription

Get 1 year access to all of our current and future products and 1 year of professional support -- 99 for just 49! (Summer Sale)

No support per domain or website installation limits! Includes all of our current and future Joomla!® extensions, Joomla!® templates for the duration of your membership. This means, by purchasing an All Extensions Subscription you'll have it all covered!

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here