Batfastad Posted December 14, 2004 Posted December 14, 2004 Hi I'm working on a FileMaker based content management system. Users post their updates into the system and they appear on the web. I'm trying to make a field so that it shows the first 90 or so words of an update, so that I can do a PHP include to it on the front page. When users make an update, certain users can post HTML in theirs. In my synopsis field, I've tried the LeftWords function and the MiddleWords function and both seem to produce the desired effect. Apart from... Where a user has put html in the opening line of their update For example <img src="http://imagelocation" alt="" border="0" align="right" />rest of update follows on from here Then the opening < gets cut off from the synopsis field by both LeftWords and MiddleWords. Obviously then the image doesn't display properly. Is there a way to get this to work in a calculation but witout the clipping of the opening '<' character?? Why does the opening '<' character get cut off? If there's text in front of the opening '<' then it works. Any ideas? Batfastad
Batfastad Posted December 14, 2004 Author Posted December 14, 2004 Even if I go like this in my synopsis field... MiddleWords( Middle( UPDATE TEXT, 0, 20000) , 0, 80) The leading '<' still gets cut off Any ideas? Thanks Ben
QuinTech Posted December 14, 2004 Posted December 14, 2004 How about Case( Left( UPDATE TEXT, 1) = "<" , "<" ) & [YOUR ORIGINAL CALC] J
Batfastad Posted December 14, 2004 Author Posted December 14, 2004 Excellent!! That'll fix it. Any idea why the LeftWords and MiddleWords functions clip off the leading '<'? Thanks QuinTech!!! Ben
QuinTech Posted December 14, 2004 Posted December 14, 2004 FM just doesn't recognize < as a word, that's all. Which makes sense from an English perspective, if not an html perspective. J
-Queue- Posted December 14, 2004 Posted December 14, 2004 In case your text ends with a closing carat or you just want to be safe, you could also use something like Substitute( Substitute( MiddleWords( Substitute( Substitute( UPDATE TEXT, "<", "YYYY" ), ">", "ZZZZ" ), 0, 80 ), "YYYY", "<" ), "ZZZZ", ">" )
Batfastad Posted December 14, 2004 Author Posted December 14, 2004 Excellent. Thanks for all your help guys. Ben
Recommended Posts
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