PJ Wassermann Posted May 25, 2003 Posted May 25, 2003 hi there I use InlineAction to display a couple of picture links on the right side of a website. Inside InlineAction I use [FMP-Record] so I can display more than one link. Unfortunately I haven't found a way to have the links sorted - is there a command? If not, could I use a script somehow to realize the sort? kind regards PJ Wassermann
Pupiweb Posted May 25, 2003 Posted May 25, 2003 Add the sort tags in the Inline [... ,-sortfield=TheFieldYouWantToSortOn,-find]
Unable Posted May 25, 2003 Posted May 25, 2003 You might refer to your CDML Reference Database and look at -Sort, -SortOrder and -SortField.
PJ Wassermann Posted May 25, 2003 Author Posted May 25, 2003 Hi Pupiweb The problem is that there is no real documentation about the syntax in the reference (or I'm too stupid to find it). This is my code and it doesn't work so far: [FMP-InlineAction: -db={CurrentDatabase}, -lay={CurrentLayout}, -max={100}, -sortfield={Code}, Section="bigLink", -find]<br> [FMP-RECORD] <a href="[FMP-Field: F_web_URL]" target="_blank"><img src="[FMP-Image: Pic]" alt="[FMP-Field: URL]" width="115" align="top" border="0"></a><br> <br> [/FMP-RECORD] [/FMP-InlineAction] kind regards PJ Wassermann
Unable Posted May 25, 2003 Posted May 25, 2003 Please refer to your CDML Reference Database and study the difference between the action tags -find and -findall.
PJ Wassermann Posted May 25, 2003 Author Posted May 25, 2003 Hi Unable Sorry to tell you that but IMHO the reference tool is far from being really helpful. It's incomplete and there are way too few examples. For instance in the explanation of findAll there's absolutely no hint on sorting. So find is a search request using defined criteria and findAll finds all according to the search criteria - I don't really understand the difference. And what about sorting? It still doesn't work with findAll. I need to know what kind of brackets or quotes and in what order to set up the commands of the string. I don't use FMP because I like to solve puzzles, I want to reach the goal of setting up a specific dynamic website and I want to learn as quickly as possible. It's not only FMP, most computer manuals are substandard, written by an elite few for the chosen ones and ignoring the needs of people who are determined to learn but in the most efficient way possible so they can spend their lives with their families and friends. Sorry to get carried away but it makes me angry to spend so much time on such a minor issue. Thanks for your help anyway. kind regards PJ Wassermann
Unable Posted May 25, 2003 Posted May 25, 2003 "Sorry to tell you that but IMHO the reference tool is far from being really helpful." You will find that most experienced developers will tell you that the CDML Reference Database is your best friend for CWP development. Don't confuse the Reference db with the CDML tool, which is a piece of crap. "... the explanation of findAll there's absolutely no hint on sorting." Perhaps that is because the -FindAll tag is what is being discussed and to find out about sorting you need to read the -SortRelated tags. "I want to learn as quickly as possible." Ok, and people in hell want ice water. However there is a learning curve for CDML. In order to overcome that you must read, study and try things. One of your best references for this is (believe it or not) the CDML Reference Database. Another good reference is in the Internet Forums here. There are a couple of years worth of useful data. You should spend some time reading as many of these threads as possible. As a developer, quite frankly, that is part of your job. Another good source for newbies is the Sample Files forum. If you truly want to learn, you will take the time to find the FREE sample files which relate to web publishing. There are at least 4 or 5. Run them through your localhost, look at the db files, read the format files. And since you are not the only one with problems, it will help you if you spend some time every day reading the current problems of others. Many will apply to the learning you are attempting. "...it makes me angry to spend so much time on such a minor issue..." Well you are best advised to get over that anger issue. Remember, if it were easy, your boss would be doing it and you'd still be looking for a job. So take three deep breaths and go have some fun with this stuff. "It's not only FMP, most computer manuals are substandard, written by an elite few for the chosen ones and ignoring the needs of people who are determined to learn but in the most efficient way possible so they can spend their lives with their families and friends." Well then get a book about FMPro and web publishing and read it on the job; get the sample files and study them on the job; read as many threads of these forums as you must - on the job; and spend your off hours with your family and friends. Who is in charge of your life after all is said and done? It is often helpful to look at the database file with a "Modify Last Find" after you have performed a -find (-findall, -findany) action in your browser. You can see what was entered (if anything) for the search. This can provide a clue. Oh, and one other bit of developer knowledge. In your inlineaction, try it without the anchor and the img references. Make the code it's simplest. When that works you can add the rest. An experineced developer's technique, kinda recommended for use by newbies: one step at a time. It's been recommended in these Forums on more than one occassion. Good Luck.
Fenton Posted May 26, 2003 Posted May 26, 2003 I'm no great CDML expert. But I'll bet that the problem is that you're overusing the "intertag" syntax. Too many {} brackets. They are needed for things like {CurrentToken:2}, but not for fields, and definitely not for fixed values. This works: [FMP-InlineAction: -db=Alerts.fp5, -lay=Main, -max=50, -sortfield=Date, -sortorder=descending, -findall] [FMP-Record] <tr > <td class="schbody">[FMP-Field: Date]</td> <td>   </td> <td class="schbody">[FMP-Field: Alert]</td> </tr> [/FMP-Record] [/FMP-InlineAction]
PJ Wassermann Posted May 26, 2003 Author Posted May 26, 2003 Hi Fenton Thanks for the code sample. I'll try it out as soon as I'm back from a different job (need to travel for a couple of days). and hi Unable Of course you're right - and I'm right, too. It's a question of personal philosophy and I got off topic. Thanks for your helpful hints on programming methodology. kind regards PJ Wassermann
Anatoli Posted May 26, 2003 Posted May 26, 2003 "Sorry to tell you that but IMHO the reference tool is far from being really helpful." You will find that most experienced developers will tell you that the CDML Reference Database is your best friend for CWP development. Don't confuse the Reference db with the CDML tool, which is a piece of crap. I am one of the gang with some CDML experience. The CDML Reference Database is *the only* resource I've ever used. It is complete and great! Only if all FM documents where so great. 10 web applications I've created wouldn't exist without it!
PJ Wassermann Posted May 30, 2003 Author Posted May 30, 2003 Hi Fenton I tried this, adapting your code to my situation: [FMP-InlineAction: -db=gmcontent.fp5, -lay=all, -max=50, -sortfield=Code, -sortorder=ascending, Section="bigLink", -find] [FMP-RECORD] [FMP-Field: F_web_URL] <br> [FMP-Image: Pic]<br> <br> [/FMP-RECORD] [/FMP-InlineAction] In my case, I can't use findAll, because I only want the data where the field Section contains "bigLink". But it doesn't work. Have you got a hint? kind regards PJ Wassermann
PJ Wassermann Posted June 1, 2003 Author Posted June 1, 2003 Thanks to everybody who contributed. It's working and the code goes like this: [FMP-InlineAction: -db=gmcontent.fp5, -lay=all, -max=50, Section=bigLink, -sortfield=Code, -sortorder=descending, -find] [FMP-RECORD] <a href="[FMP-Field: F_web_URL]" target="_blank"> <img src="[FMP-Image: Pic]" alt="[FMP-Field: URL]" width="115" align="top" border="0"></a><br> <br> [/FMP-RECORD] [/FMP-InlineAction] PJ Wassermann
Recommended Posts
This topic is 7915 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