Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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.

Code Block
languagexml
titleThe

...

code
syntax is mainly like this:
linenumberslanguagexmltrue
<%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
subtletrue
colourRed
title<%emswitch%>
 and ends with
Status
subtletrue
colourRed
title<%endemswitch%>
 keyword. You can use more than one emswitch area in an html.


In a <%emswitch%> area

Status
subtletrue
colourRed
title<%emswitch%>
 area you can use different conditions. A condition starts with
Status
subtletrue
colourRed
titleemcase:
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
subtletrue
colourRed
titleemcaseelse
 keyword.

Emswitch emswitch module allows you to use different operators in emcase conditions. These operators are

Status
subtletrue
colourRed
title=
, <, > and <>.·        = operator  
Status
subtletrue
colourRed
title>
,
Status
subtletrue
colourRed
title<
 and
Status
subtletrue
colourRed
title<>
.

...

  • Status
    subtletrue
    colourRed
    title=
     operator returns true, if two values are equal. This operator works for both string and integer values.

...

  • Status
    subtletrue
    colourRed
    title>
     operator returns true if first value is greater than the second one. This operator works only for integer values.

...

  • Status
    subtletrue
    colourRed
    title<
     operator returns true if first value is less than the second one. This operator works only for integer values.

...

  • Status
    subtletrue
    colourRed
    title<>
     operator returns true, if two values are not equal. This operator works for both string and integer values.


Note

In

...

an emcase condition you can use more than one comparision areas and execute these comparisons with “and”, “or” keywords.

Code Block
languagexml
titleHere is an example with the use of all supported features

...

Code Block
languagexml
linenumberstrue
<%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
borderColorgreen
borderStyledashed
titleThe output html after rendering will look like this:

content4

...

<some html

...

here...>

content6

content11

...

Code Block
languagexml
titleAnother example about

...

emswitch, with RMC

...

demographic field notation.
linenumberstrue
<%emswitch%>

...


emcase:('<##city##>' = 'istanbul')

...


{

...


 content about istanbul

...


}

...


emcase:('<##city##>' = 'ankara')

...


{

...


content about ankara

...


}

...


emcaseelse

...


{

...


content for all cities

...


}
<%endemswitch%>

...

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.