Jump to content

field format to display html in a FMPro field correctly


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

Recommended Posts

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.

Link to comment
Share on other sites

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>

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This topic is 8443 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
×
×
  • Create New...

Important Information

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