logo
Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Options
Go to last post Go to first unread
Erwin  
#1 Posted : Wednesday, March 28, 2012 4:17:31 PM(UTC)
Erwin

Rank: Administration

Reputation:

Groups: Moderators, Administration, Member
Joined: 10/8/2008(UTC)
Posts: 44

For fields in a view, there are now several parameters available for textfields only.
With these parameters, single-, doublequotes and line-breaks can be replaced in the string fields so javascript or the look and feel can be optimized.
Example: the use over tablename.fieldname in the views can be changed to add one or more of the following Parameters:
ReplaceLineBreaks (CrLf becomes html br)
ReplaceSingleQuoteToHtml (single quote replace to htmlcode)
ReplaceSingleQuoteToJs (single quote replace with \')
ReplaceDoubleQuoteToHtml (double quote replace to htmlcode)
ReplaceDoubleQuoteToJs (double quote replace to \")
ReplaceHtmlEncode (for link tags replacable chars will be replaced to html, for instance < becomes htmlcode)
REPLACEDOTFORVIEWCONTROL (replaces dots to a | so a "." will be replaced for a "|")

An example in the view layout could be tablename.fieldname.ReplaceLineBreaks.ReplaceSingleQuoteToHtml between the normal tags.

There is also a function within the pbw library, called

Replace_FieldParametersToHtml(Value as string, Parameters as string) as string

Will do all replaces on the value string, for the keywords who are in Parameters string.
Example: NewString = pbw.Replace_FieldParametersToHtml(NewString,"ReplaceLineBreaks.ReplaceSingleQuoteToHtml")

Edited by user Monday, November 4, 2013 12:22:03 PM(UTC)  | Reason: Not specified

Wanna join the discussion?! Login to your Sienn Forum forum account. New Registrations are disabled.

Guest  
#2 Posted : Friday, March 30, 2012 4:32:06 AM(UTC)
Guest

Rank: Guest

Groups: Guest
Joined: 9/17/2008(UTC)
Posts: 66

Those tips and suggestions are very helpful. Thanks for sharing it to us.

Edited by moderator Monday, April 2, 2012 2:19:25 PM(UTC)  | Reason: Not specified

Erwin  
#3 Posted : Monday, October 14, 2013 3:36:34 PM(UTC)
Erwin

Rank: Administration

Reputation:

Groups: Moderators, Administration, Member
Joined: 10/8/2008(UTC)
Posts: 44

With the current SIENN engine, if you use a field multiple times in a view and you want to use this function (example .ReplaceDoubleQuoteToJs) you have to put it on ALL fields (otherwise only the last field will be inserted by SIENN)

A:{!!ShopArtikel.Omschrijving!!} and B:{!!ShopArtikel.Omschrijving.ReplaceDoubleQuoteToJs!!}
will result in:
Code:
A:{!!ShopArtikel.Omschrijving!!} and  B:Titel of \"the\" article


...but
A:{!!ShopArtikel.Omschrijving.ReplaceDoubleQuoteToJs!!} and B:{!!ShopArtikel.Omschrijving.ReplaceDoubleQuoteToJs!!}

will result in:
Code:
A:Titel of \"the\" article and  B:Titel of \"the\" article
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.