RMC system allows use of conditions according to some system values with a special notation in html content. This notation is names has named as “emswitch”emswitch, and with use of this system will produce different html contents for each member according to their demografic demographic information.
...
syntax is mainly like this: |
|
codelinenumbers | language | xmltrue |
---|
|
<%emswitch%>
emcase:(demografic_value_of_member_1 operator_1 value_1)
{
Content1
}
emcase:(demografic_value_of_member_2 operator_2 demografic_value_2)
{
Content2
}
emcaseelse
{
Content3
}
<%endemswitch%>
|
Note |
---|
The notation starts with |
...
Status |
---|
| |
---|
subtle | true |
---|
colour | Red |
---|
title | <%emswitch%> |
---|
| and ends with Status |
---|
| |
---|
subtle | true |
---|
colour | Red |
---|
title | <%endemswitch%> |
---|
| keyword. You can use more than one emswitch area in an html. |
In a <%emswitch%> area Status |
---|
| |
---|
subtle | true |
---|
colour | Red |
---|
title | <%emswitch%> |
---|
|
area you can use different conditions. A condition starts with Status |
---|
| |
---|
subtle | true |
---|
colour | Red |
---|
title | emcase: |
---|
|
syntax syntax, then condition must be defined in brackets, if a condition is true system will use html or text block in those brackets. System always look for one match in the conditions and uses content of first true condition and than exists from that emswitch area. If none of the conditions are true than you can use content with a emcaseelse keyword Status |
---|
| |
---|
subtle | true |
---|
colour | Red |
---|
title | emcaseelse |
---|
|
keyword.
Emswitch emswitch module allows you to use different operators in emcase conditions. These operators are Status |
---|
subtle | true |
---|
colour | Red |
---|
title | = |
---|
|
, Status |
---|
| |
---|
subtle | true |
---|
colour | Red |
---|
title | > |
---|
|
, <, > and <>.· = operator Status |
---|
subtle | true |
---|
colour | Red |
---|
title | < |
---|
|
and Status |
---|
| |
---|
subtle | true |
---|
colour | Red |
---|
title | <> |
---|
|
.
Status |
---|
subtle | true |
---|
colour | Red |
---|
title | = |
---|
|
operator returns true, if two values are equal. This operator works for both string and integer values.
...
Status |
---|
| |
---|
subtle | true |
---|
colour | Red |
---|
title | > |
---|
|
operator returns true if first value is greater than the second one. This operator works only for integer values.
...
Status |
---|
subtle | true |
---|
colour | Red |
---|
title | < |
---|
|
operator returns true if first value is less than the second one. This operator works only for integer values.
...
Status |
---|
| |
---|
subtle | true |
---|
colour | Red |
---|
title | <> |
---|
|
operator returns true, if two values are not equal. This operator works for both string and integer values.
Note |
---|
In a emcase condition you can use more than one comparision areas and execute these comparisons with “and”, “or” keywords. |
Code Block |
---|
language | xml |
---|
title | Here is an example with the use of all supported features |
---|
|
...
Code Block |
---|
language | xml |
---|
linenumbers | true |
---|
|
<%emswitch%>
emcase:(23<>23)
{
content1
}
emcase:(22=27)
{
content2
}
emcase:(33<>33)
{
content3
}
emcaseelse
{
content4
}
<%endemswitch%>
some html or text here...
<%emswitch%>
emcase:(23=22 and 35=35)
{
content5
}
emcase:(23=22 or 35=35)
{
content6
}
emcaseelse
{
content8
}
<%endemswitch%>
<%emswitch%>
emcase:('text' <> 'text')
{
content10
}
emcaseelse
{
content11
}
<%endemswitch%> |
Panel |
---|
borderColor | green |
---|
borderStyle | dashed |
---|
title | The output html after rendering will look like this: |
---|
|
content4 |
...
...
here...> content6 content11 |
...
Code Block |
---|
language | xml |
---|
title | Another example about |
---|
|
...
...
demographic field notation. | linenumbers | true |
---|
|
<%emswitch%> |
...
emcase:('<##city##>' = 'istanbul') |
...
...
...
...
emcase:('<##city##>' = 'ankara') |
...
...
...
...
...
...
...
...
Note |
---|
Here system will render and produce html output for all members according to their city information. |
Warning |
---|
An important point about emswitch module is that you do not need to |
...
seperate whole html in the emcase areas. Only the different content between conditions should be used in the emcase fields. |