Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Checking if containter is empty in CDML

Featured Replies

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

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

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...

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.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.