Jump to content

This topic is 8930 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I have 6 container fields in a database. Some will get filled with a picture and some won't. I want to display these images if they are there. I dont want to lay down <img src> tags if I dont need to. How can I write a page so [FMP-if:Field:image1.eq.true]<img src="[Field:image:image1]">[/FMP-if]or something like this will just check the container field. All my efforts have returned nothing, a blank area. A repeating field for some reason returns the number "1" instead of a picture.

If anyone can help, I'd appreciate it.

Rich

------------------

Rich

Posted

You might need to create some more calculation fields in your database that use the IsEmpty() function to check the status of the container fields -- the IsEmpty() function will be true if there is nothing in the container field.

Then do your other stuff based on the results from the calculation fields.

  • Newbies
Posted

close, just change the .eq.true to .neq

This tells FMP is there is nothing there, ignore the image link. IE.

[FMP-if:Field:image1.neq]<img src="[Field:image:image1]">[/FMP-if]

  • 4 weeks later...
Posted

Yes Riprod, you are quite right there. When the IsEmpty() is TRUE you don't want to display the image reference!

Congratulations you've spotted the deliberate mistake!*

*There is an Australian talk-back radio host who used to have a "deliberate mistake" prize giveaway on his show to callers who would correct his errors -- perhaps a cheesy way of covering his blunders. This same announcer was recently embroiled in a "cash for comments" scandle, where on-air comments assumed to be editorial were actually paid advertisements. "I'm an entertainer, not a journalist" was his defence. Very dodgy.

This topic is 8930 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.