The Community forums are being phased out in favor of a new Slack group.
Add your email address below to get an invitation to join the community slack group

Slack Signup
Newsletter Optin
Help Desk

Display image with conditionals

Labels

This Discussion is public

Notifications

I building a new real estate website.

devwwerealty.com.temp.realssl.com/

I have written code that will display the listing images with a corner ribbon banner with text (e.g. Pending, Sold or New).

I need to display the image also if the listing has a status "Available"  - The problem is that I haven't found a way to write the conditionals where the image won't show up twice (in the event it has an available status but also has the checkbox "New" Banner checked, etc.

The ribbon banner code has to wrap the image in a box which is not an issue where I need to display "New Listings" (like you see on the home page) on a page or  "Sold" Listings in a second view at the bottom on a listing page.  The problem is with New properties which have an "available" status but also have the New click box on.

 

 

Here's the basic code to show new listings:

[if 420 equals="Yes"]<div class="box"><a href="http://devwwerealty.com.temp.realssl.com/property-details/?pass_entry=[id]"><img src="[449 size="full"]" max-height="300px"/></a><div class="ribbon"><span>NEW</span></div></div>[/if 420]

Here's a page that shows the problem:

devwwerealty.com.temp.realssl.com/nc-mountains-residential-homes-for-sale/

<a href="http://devwwerealty.com.temp.realssl.com/property-details/?pass_entry=[id]"><img src="[449 size="full"]" max-height="300px"/></a>[if 420]<div class="box"><div class="ribbon"><span>NEW</span></div></div>[/if 420]

Does anyone know how to solve this problem?

Hello Rita,

Did you change anything? I can't see the problem on the indicated page.

Have you tried two conditionals?

[if 420 equals="Yes"][if xxx equals="Available"]display if new and available[/if xxx][/if 420]

[if 420 equals="Yes"][if xxx equals="Not Available"]display if new and not available[/if xxx][/if 420]

Antonio

Antonio,

I was able to get things working with this code:

 

<div class="box"><a href="http://devwwerealty.com.temp.realssl.com/property-details/?pass_entry=[id]" target="_blank"/><img src="[449 size="full"]" max-height="300px"/></a>[if 594 equals="New"]<div class="ribbon"><span>NEW</span></div></div>[/if 594][if 594 equals="Reduced"]<div class="ribbon"><span>Reduced</span></div>[/if 594][if 594 equals="Pending"]<div class="ribbon"><span>Pending</span></div>[/if 594][if 594 equals="Sold"]<div class="ribbon"><span>SOLD</span></div>[/if 594]</div>

 

I had to put the box for the image class first, then the image, then the conditionals.

Thanks for you help.

Discussion closed.