Render HTML code from database as HTML

Render HTML code from database as HTML

  
Hi,

I'm currently working on a module wherein I have 2 fields: Title and Article. It is a CMS type of application. I would want the article to accept HTML codes (example: <b> text here </b>). That's okay but I want to also show this in HTML. So if I retrieve the article from the database, I want to display those enclose in bold tags as bold, etc.

Is it possible? 

Thanks
Hi Geraldine,

You can do that using an expression with the property "Escape Content" set to the value "No".
This way you're allowed to inject HTML to you're screen, in your case, from the DataBase.

Regards,
Gonçalo M.
Thank you, Gonçalo Martins!
Hi,

Also when using un-escaped expressions you really need to be carefull, because it can allow unintended usages.
Many tags, For example <script> tags or even links can be dangerous if you allow anything to be included.
Read this: http://en.wikipedia.org/wiki/Cross-site_scripting

Regards,
João Rosado

The "Escape content" function isn't available in Outsystems 10 on the Mobile side. So, all the HTML in my backend isn't shown properly in the frontend. 


How can I change this? 


João Rosado wrote:

Hi,

Also when using un-escaped expressions you really need to be carefull, because it can allow unintended usages.
Many tags, For example <script> tags or even links can be dangerous if you allow anything to be included.
Read this: http://en.wikipedia.org/wiki/Cross-site_scripting

Regards,
João Rosado



I'm having the same issue as Martin: I'm pulling raw HTML content from Sharepoint that I'm having difficulty displaying on the Mobile side.

Mykola Tkachenko wrote:

Hi

Here is some solution that can work

http://www.outsystems.com/forums/discussion/20510/unescaped-content-on-mobile-app-v10/

This worked nicely, thanks!


Hi Kevin, 

Did you use it on mobile app with phone theme?

It did not work for me with this theme but worked with another.

I am using the phone theme, and some of the styles also seem to not be applying. I was just happy that I wasn't seeing HTML tags anymore.

Coincidentally, one of the tags that isn't displaying properly is also the <strong> tag. It looks like it's being overridden by the Base Theme, specifically the "font: inherit" property.