Difference between revisions of "Ssescape"
From SmartWiki
Line 1: | Line 1: | ||
− | This syntax | + | This syntax functions to "escape" double quotes on text fields. The purpose of this is to avoid breaking the code on the page when field values containing double quotes are referenced on [[Template_Formula|Template Formulas]], [[Visibility_Condition|Visibility Conditions]] and [[Browser_Script|Browser Scripts]]. |
− | + | '''IMPORTANT:''' This syntax will only escape double quotes (") | |
<ssEscape>.....</ssEscape> | <ssEscape>.....</ssEscape> | ||
Line 7: | Line 7: | ||
'''Examples''' | '''Examples''' | ||
− | * When using template | + | * When using template formulas to escape double quotes from a [[Custom_Field_Type:_Text_–_Single_Line|single line text field]]. |
@level1.name@="<ssEscape>@level1.Proposal Title@</ssEscape>"; | @level1.name@="<ssEscape>@level1.Proposal Title@</ssEscape>"; | ||
− | * When using template | + | * When using template formulas to escape double quotes from a [[Custom_Field_Type:_Text_–_Multiple_Lines| multiple lines text field]]. |
@level1.description@="<ssEscape>@level1.Project Description.'''value'''@</ssEscape>"; | @level1.description@="<ssEscape>@level1.Project Description.'''value'''@</ssEscape>"; | ||
− | * When using [[Browser_Script|browser | + | * When using [[Browser_Script|browser scripts]] to escape double quotes from a variable. |
var name="<ssEscape>@name@</ssEscape>"; | var name="<ssEscape>@name@</ssEscape>"; | ||
if(name=="") | if(name=="") | ||
function goes here.... | function goes here.... | ||
− | * When using [[Sslogic]] or [[Visibility_Condition|visibility | + | * When using [[Sslogic]] or [[Visibility_Condition|visibility conditions]] to escape double quotes from a single line text field. |
<pre> | <pre> | ||
<!--@sslogic("<ssEscape>@name@</ssEscape>"!="")--> | <!--@sslogic("<ssEscape>@name@</ssEscape>"!="")--> |
Revision as of 14:48, 25 June 2013
This syntax functions to "escape" double quotes on text fields. The purpose of this is to avoid breaking the code on the page when field values containing double quotes are referenced on Template Formulas, Visibility Conditions and Browser Scripts.
IMPORTANT: This syntax will only escape double quotes (")
<ssEscape>.....</ssEscape>
Examples
- When using template formulas to escape double quotes from a single line text field.
@level1.name@="<ssEscape>@level1.Proposal Title@</ssEscape>";
- When using template formulas to escape double quotes from a multiple lines text field.
@level1.description@="<ssEscape>@level1.Project Description.value@</ssEscape>";
- When using browser scripts to escape double quotes from a variable.
var name="<ssEscape>@name@</ssEscape>"; if(name=="") function goes here....
- When using Sslogic or visibility conditions to escape double quotes from a single line text field.
<!--@sslogic("<ssEscape>@name@</ssEscape>"!="")--> There's a project title with double quotes <!--@end-->