Showing an image IF a field is completed

Discuss news styles, css code, and other Coranto customizations in here...the possibilities are endless, so have at it!

Moderator: Spunkmeyer

Showing an image IF a field is completed

Postby MrQwest » Fri Nov 17, 2006 12:32 pm

I've got another question.

I run a website for a club based in London. I generally put on flyers for events every month. These flyers have a front and back.

I've set up my news style so that it has all the HTML already there, i just put in the image URL into a custom text field in the "submit news" post, and the code does the rest.

HOWEVER, this week, i've only had to put up one image, so that's left a broken image for the second peice of code.

Is there some perl code that i can use, like an IF function to say "if the field is blank, ignore the HTML, but if the field has a URL, include the HTML".

Is that possible?
MrQwest
 
Posts: 21
Joined: Tue Mar 01, 2005 2:23 pm

Postby Dale Ray » Fri Nov 17, 2006 2:50 pm

Code: Select all
<If: Field: CustomField_YourField>Do something here</If>


Anything you put between the IF tags will only be used if the field is not blank.

See:
NEWS STYLE DOCUMENTATION
Default Style Tags
Coranto tutorial part 3 - Profiles, styles and templates
for more style documentation.

More Coranto info:
Coranto Guides Page
Coranto FAQ Page
(Almost) ALL of your questions are answered here. (Forum Thread)
Dale Ray
User avatar
Dale Ray
 
Posts: 1004
Joined: Sun Jan 19, 2003 6:02 pm
Location: NW Indiana


Return to Customization

Who is online

Users browsing this forum: No registered users and 2 guests

cron