Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Transformation ifEmpty and %nbsp; View modes: 
User avatar
Certified Developer v7
Certified  Developer v7
kmerlihan-ecentricarts - 3/20/2011 7:39:17 PM
   
Transformation ifEmpty and %nbsp;
Hi there!

I have created a doctype for my client to enter a description about a media item. If they leave the field empty, I would like to use a default text.

This is the code i have in the transformation:
<p><%# IfEmpty(Eval("MediaInfo"), "Some default text", Eval("MediaInfo")) %></p>

I think this should work, however if "MediaInfo" is left blank, the wysiwyg editor adds in " " and it is no longer blank. The default text is never used.

Any thoughts?

Cheers
Kathryn

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 3/21/2011 3:41:35 PM
   
RE:Transformation ifEmpty and %nbsp;
Hi,

I assume that you are using FireFox browser - regrettably this is a known issue with FireFox and the WYSIWYG Editor. In IE browser is nothing added.

You can find some details about the bug here: http://dev.fckeditor.net/ticket/1660

The workaround may be creating of custom transformation function that will check if the field is not empty or does not contain nbsp;

Best regards,
Ivana Tomanickova