June 6, 200124 yr What is the best way in CDML to display field content. I have two issues. When a client adds returns in a FMPro field they don't display correctly when viewed on the web. The returns don't display at all on the Mac and will only act as returns on the PC if he adds a space after each return. Also, is there a way to display urls as links. It doesn't seem to work to add the <a href> and </a> tags. Instead of a link, you just see the tags "printed" in the field. I know that there are options for the fields when creating CDML, ie. raw, html, etc, but I've never figured them out.
June 7, 200124 yr For the text to display on the web, create a calculation field. If the comment field is 'comment', create one called 'comment_html', for instance. It should be a calculation set to: Substitute(comment, "***new paragraph symbol***", "<br>"). In your CDML, the tag will look like: [FMP-field: comment_html, Raw]. As far as URL's as links, I assume that the URL link is a field in the database . Your CDML should simply be: <a href="[FMP-field: URL_field_name]">insert whatever should display on the page here</a>
June 7, 200124 yr Author Thanks for the info. Works great. One questions though. My url's aren't in separate fields. A calculation to replace carriage returns is easy. How about a calculation that would find a word that would contain a ".htm" in it so I could bracket the word with the proper href tags?
June 7, 200124 yr If the URL is in a field and needs to be parsed out then you're getting complicated. If you are sure that every URL ends in '.htm' then it's relatively easy. However, some urls simply end in .com, .net, maybe a back slash, perhaps .asp, .cfm, you get the idea. If every URL begins with http:// you could approach it that way, if it's consistent.
Create an account or sign in to comment