Jump to content

FMP-IF Syntax Help


kele
 Share

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

Recommended Posts

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This topic is 6503 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
 Share

×
×
  • Create New...

Important Information

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