kele Posted March 31, 2004 Posted March 31, 2004 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
Garry Claridge Posted March 31, 2004 Posted March 31, 2004 "&" is only used in URL construction. For example: http://address/FMPro?-db=mydb.fp5&-format=mypage.html&-view I assume that the Categories are returned in a random order. If that is the case you may need to use some Javascript for constructing the Table. All the best. Garry
kele Posted March 31, 2004 Author Posted March 31, 2004 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?
Jeff Spall Posted March 31, 2004 Posted March 31, 2004 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
Garry Claridge Posted March 31, 2004 Posted March 31, 2004 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
Recommended Posts
This topic is 7612 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 accountSign in
Already have an account? Sign in here.
Sign In Now