[lasso 9.3.1] Retain record text formatting of value in a map

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[lasso 9.3.1] Retain record text formatting of value in a map

Tom W Robinson
I've got a map of maps from records_map and one of the values has some formatted text (bold, paragraph etc.) from the record which I want to retain.  I can see the formatting when using [$Map], but when I use $Map->Get(key)->Find(value) I lose the formatting.  Is there anyway to pull that value and retain the formatting?  I used to use [field: 'field', raw] when I working directly with the database.

Thanks,

Tom
Reply | Threaded
Open this post in threaded view
|

Re: [lasso 9.3.1] Retain record text formatting of value in a map

Brad Lindsay
I think you may want to look at [string->encodeHtml]:
http://www.lassosoft.com/lassoDocs/languageReference/obj/string/encodehtml

My guess is that you want something like
[#my_map->get(key)->find(other_key)->encodeHtml(false, true)]

HTH,
Brad

On September 15, 2016 at 7:53:37 PM, Tom W Robinson ([hidden email]) wrote:

> I've got a map of maps from records_map and one of the values has some
> formatted text (bold, paragraph etc.) from the record which I want to
> retain. I can see the formatting when using [$Map], but when I use
> $Map->Get(key)->Find(value) I lose the formatting. Is there anyway to pull
> that value and retain the formatting? I used to use [field: 'field', raw]
> when I working directly with the database.
>
> Thanks,
>
> Tom
>
>
>
> --
> View this message in context: http://lasso.2283332.n4.nabble.com/lasso-9-3-1-Retain-record-text-formatting-of-value-in-a-map-tp4645481.html 
> Sent from the Lasso - Talk mailing list archive at Nabble.com.
>
> #############################################################
>
> This message is sent to you because you are subscribed to
> the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to:
> Send administrative queries to
>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: [lasso 9.3.1] Retain record text formatting of value in a map

Tom W Robinson
Hi Brad,

Well, I thought adding ->encodehtml(false, true) worked, but this morning I realized that while troubleshooting this issue yesterday I had surrounded the bolded word with , when I remove the hard coding and just use Filemaker's bold command, I lose the formatting.

I'm using Filemaker Server 13.  When I look at the raw source of my map in the web browser, I see that when the enduser formats the text using Filemaker's menu commands,  it uses CSS to format text... ie.   I lose this html when using ->encodehtml(false, true)

Any other suggestions? other than control this by having my users use a web interface to build record data (note sure if browser WYSIWYG editors use  ) rather than use Filemaker.

Thanks,

Tom
Reply | Threaded
Open this post in threaded view
|

Re: [lasso 9.3.1] Retain record text formatting of value in a map

maxwellk2
Hi Tom,

It sounds like you might already be doing this, but in case not, FileMaker can return field formatting as CSS:

        https://www.filemaker.com/help/15/fmp/en/index.html#page/FMP_Help/getascss.html

I use it frequently to covert style formatting in FileMaker that needs to display on a web page, it has the additional benefit of encoding special characters for HTML. Often size and font formatting isn't desired so I'll create a calculation filed for Lasso that looks like this:

        GetAsCSS ( TextSizeRemove ( TextFontRemove ( source_field ) ) )

There's a number of similarly handy functions that can be found on Brian Dunning's custom function site:

        http://www.briandunning.com/filemaker-custom-functions/list.php


HTH,
Max


> On Sep 16, 2016, at 5:37 AM, Tom W Robinson <[hidden email]> wrote:
>
> Hi Brad,
>
> Well, I thought adding ->encodehtml(false, true) worked, but this morning I
> realized that while troubleshooting this issue yesterday I had surrounded
> the bolded word with **, when I remove the hard coding and just use
> Filemaker's bold command, I lose the formatting.
>
> I'm using Filemaker Server 13.  When I look at the raw source of my map in
> the web browser, I see that when the enduser formats the text using
> Filemaker's menu commands,  it uses CSS to format text... ie.   I lose this
> html when using ->encodehtml(false, true)
>
> Any other suggestions? other than control this by having my users use a web
> interface to build record data (note sure if browser WYSIWYG editors use  )
> rather than use Filemaker.
>
> Thanks,
>
> Tom
>
>
>
> --
> View this message in context: http://lasso.2283332.n4.nabble.com/lasso-9-3-1-Retain-record-text-formatting-of-value-in-a-map-tp4645481p4645483.html
> Sent from the Lasso - Talk mailing list archive at Nabble.com.
>
> #############################################################
>
> This message is sent to you because you are subscribed to
> the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>


Thanks,
Max

____________________________________________
Maxwell Klein Consulting, Inc.
Database Development & Web Integration


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: [lasso 9.3.1] Retain record text formatting of value in a map

Tom W Robinson
In reply to this post by Tom W Robinson
Hi Max,

Thanks for the reply....  I was looking at the GetAsCSS function, but I think the CSS is the issue

Unfortunately the HTML/CSS code in my reply to Brad above was scraped, so it probably didn't make much sense.  

The bolded text from the filemaker field uses CSS with the following syntax:  

span style = font-weight: bold; /span ....    rather than the html tags b /b  .  

In the map that is generated from the records_map tag I see the css and if I call the entire map on a web page the text appears bold.  The only way I know how to pull a specific value from the map is using:

[#my_map->get(key)->find(other_key)]

If the filemaker field had the b /b html tags then using [#my_map->get(key)->find(other_key)->encodeHtml(false, true)] would work fine.  

Unless I am completely off base, I need something like a Filemaker GetAsHTML text function, which I don't think exists, a way to do a map->replace(string,string) ,  or another way to get the "raw" map value.

Thanks,

Tom