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.

FMP-IF Syntax Help

Featured Replies

I have a table with 7 columns that is displayed based on a search of field1.

The search can return multiple values.

In each of the columns I want to display items in a certain category (1-7)

I also want to repeat for each value that was found in that category.

e.g.

apple | peas | pork

orange | corn | beef

pear | asparagus | chicken

So here is the markup I tried applying to a cell in the table/form:

[FMP-if: field: category .eq. fruit]&

[FMP-record]

[FMP-field: item, HTML]

[/FMP-record]

[/FMP-IF]

A couple of general syntax clarifications - when should " " be used?

When is the "&" used.

Most of the examples I see of CDML string everything together and sometimes the & is used and sometimes there is just a space and I have seen the quotes used and omitted? Which is correct when?

Thanks for answering my dumb questions -

-Kele

  • Author

How about using a self relationship using CDML (I don't know javascript and this works in FMP I just can't get it to work on the web).

so in the database I created a self relationship using the category

[FMP-portal: mydatabase]

<tr>

<td height=21 width=104 valign=top>

<p><span class="style20"> [FMP-field: category::itemcategory, HTML] </span></p></td>

</td>

</tr>

[/FMP-portal]

where category = the relationship name (relationship defined for each category)

itemcategory is the field I am trying to display

Why will this work in the datbase itself and not on the web? Is the syntax OK?

Hi, i think that your only mistake in the code is here:

[FMP-portal: mydatabase]

ignoring the table stuff, it's

[FMP-PORTAL: relationship name]

[FMP-FIELD: relationship name :: field name]

[/FMP-PORTAL]

or as part of a search return or list :

[FMP-RECORD]

[FMP-FIELD: thefieldname][FMP-PORTAL: relationship name]

[FMP-FIELD: relationship name :: field name]

[/FMP-PORTAL]

[/FMP-RECORD]

...so if you had a column and portal for each category, it would display OK

as has been said many times before, those related fields must be on the FMP layout you are calling and you have to declare tha layout in the url or form or inline that generates the page

If you have a self-join Relationship for each Category, and a Portal for each of these Relationships (as Jeff said). You could do this with a table:

<tr>

<td>[FMP-Portal: cat1][FMP-Field:cat1::item]<br>[/FMP-Portal]</td>

<td>[FMP-Portal: cat2][FMP-Field:cat2::item]<br>[/FMP-Portal]</td>

<td>[FMP-Portal: cat3][FMP-Field:cat3::item]<br>[/FMP-Portal]</td>

etc......

<td>[FMP-Portal: cat7][FMP-Field:cat7::item]<br>[/FMP-Portal]</td>

</tr>

Good Luck.

Garry

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.