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.

Displaying Images with CDML from related databases

Featured Replies

I have a custom website that uses a FP5 database (we'll call MAIN-DB ) and displays records from that database using CDML. It also displays a field called field1 from a related database (EXTERNAL-DB). For the purposes of this example, the relationship we'll called LINK) so I use [FMP-FIELD: LINK::field1] . This works fine, and the related text field is displayed on the web page.

field1 happens to hold the name of a person and pic1 is a container field, holding a picture of that person in the same related database EXTERNAL-DB.

How can I pull pic1 through to appear on my website via MAIN-DB, in the same way that field1 does ?

I've tried [FMP-IMAGE: LINK::pic1] but that didn't work. And I tried a calculation field in the MAIN-DB database to get the value from the related field. Although this worked on the desktop Database, it didn't display via CDML.

My only way around is; to run a script that sets a duplicate container field in MAIN-DB from EXTERNAL-DB, but It's not a very neat solution and feel there must be a better way of linking a website directly to a related container field, as is the case with related text fields.

can you help anyone smile.gif

Thanks in advance

Gary.

Is the Related container field on the Layout used for the MainDB?

The best method is to construct the path, in HTML, from the image name. However, the names may not be available to you!

You may also be able to use an [FMP-InlineAction] to display the image.

Good Luck.

Garry

  • Author

Thanks Garry,

It was on the layout, but just as a normal linked field.

Then I created a 1 row Portal and dropped a related field in there, after this the CDML seemed to find things with no problem ;-)

The strange thing is, I then deleted the portal and it worked with just the field.

I guess it's just one of those things ;-)

Thanks for your Help.

Gary.

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.