ke Technical Documentation
Tuesday, September 21, 2010 Generic Switch Function
The generic switch function is used to show or hide content based on the values of a service, field etc. The format of the function is as follows:
Function format: |KE_GENERIC_SWITCH(name,_comma_delimited_list_)| , where:
- name - name of the parameter to consider (see example)
- _comma_delimited_list_ - comma delimeted service codes, values
Available keywords:
- |SHOW_ON_SWITCH_CASE_START_value_from_list|
- |SHOW_ON_SWITCH_CASE_END_value_from_list|
- |HIDE_ON_SWITCH_CASE_START_value_from_list|
- |HIDE_ON_SWITCH_CASE_END_value_from_list|
Example:
Service: |KE_GENERIC_SWITCH(|SERVICE_CODE|,HOME,ABOUT,CONTACT)|
|SHOW_ON_SWITCH_CASE_START_HOME|
(homepage content)
|SHOW_ON_SWITCH_CASE_END_HOME|
|SHOW_ON_SWITCH_CASE_START_ABOUT|
(about content)
|SHOW_ON_SWITCH_CASE_END_ABOUT|
|SHOW_ON_SWITCH_CASE_START_CONTACT|
(contact content)
|SHOW_ON_SWITCH_CASE_END_CONTACT|
Other field value: |KE_GENERIC_SWITCH(|USER_LEVEL|,0,1,2)|
|SHOW_ON_SWITCH_CASE_START_0|
(content for level 0 user)
|SHOW_ON_SWITCH_CASE_END_0|
|SHOW_ON_SWITCH_CASE_START_1|
(content for level 1 user)
|SHOW_ON_SWITCH_CASE_END_1|
|SHOW_ON_SWITCH_CASE_START_2|
(content for level 2 user)
|SHOW_ON_SWITCH_CASE_END_2|
Function variations:
There is a variation of this function used multiple times on a page: |KE_GENERIC_SWITCH_EX(name,prefix,_coma_delimited_list_)|
Available keywords:
- |SHOW_ON_SWITCH_CASE_START_prefix+value_from_list|
- |SHOW_ON_SWITCH_CASE_END_prefix+value_from_list|
- |HIDE_ON_SWITCH_CASE_START_prefix+value_from_list|
- |HIDE_ON_SWITCH_CASE_END_prefix+value_from_list|
|KE_GENERIC_SWITCH_EX(|USER_LEVEL|,a,0,1)|
|SHOW_ON_SWITCH_CASE_START_a0|
(content)
|SHOW_ON_SWITCH_CASE_END_a0|
|SHOW_ON_SWITCH_CASE_START_a1|
(content)
|SHOW_ON_SWITCH_CASE_END_a1|
|KE_GENERIC_SWITCH_EX(|USER_GENDER|,b,0,1)|
|SHOW_ON_SWITCH_CASE_START_b0|
(content)
|SHOW_ON_SWITCH_CASE_END_b0|
|SHOW_ON_SWITCH_CASE_START_b1|
(content)
|SHOW_ON_SWITCH_CASE_END_b1|
There are some variations of this function, used exclusively on the start repeat functions from the snippets.
Function used only once inside the snippet: |KE_GENERIC_SWITCH_INSIDE(name,_coma_delimited_list_)|
Available keywords:
- |SHOW_ON_SWITCH_INSIDE_CASE_START_value_from_list|
- |SHOW_ON_SWITCH_INSIDE_CASE_END_value_from_list|
- |HIDE_ON_SWITCH_INSIDE_CASE_START_value_from_list|
- |HIDE_ON_SWITCH_INSIDE_CASE_END_value_from_list|
Funnction used multiple times inside the same snippet: |KE_GENERIC_SWITCH_INSIDE_EX(name,prefix,_coma_delimited_list_)|
Available keywords:
- |SHOW_ON_SWITCH_INSIDE_CASE_START_prefix+value_from_list|
- |SHOW_ON_SWITCH_INSIDE_CASE_END_prefix+value_from_list|
- |HIDE_ON_SWITCH_INSIDE_CASE_START_prefix+value_from_list|
- |HIDE_ON_SWITCH_INSIDE_CASE_END_prefix+value_from_list|
Example for multiple usage of the function in the same snippet:
|KE_GENERIC_SWITCH_INSIDE_EX(|USER_LEVEL|,a,0,1)|
|SHOW_ON_SWITCH_INSIDE_CASE_START_a0|
(content)
|SHOW_ON_SWITCH_INSIDE_CASE_END_a0|
|SHOW_ON_SWITCH_INSIDE_CASE_START_a1|
(content)
|SHOW_ON_SWITCH_INSIDE_CASE_END_a1|
|KE_GENERIC_SWITCH_INSIDE_EX(|USER_GENDER|,b,0,1)|
|SHOW_ON_SWITCH_INSIDE_CASE_START_b0|
(content)
|SHOW_ON_SWITCH_INSIDE_CASE_END_b0|
|SHOW_ON_SWITCH_INSIDE_CASE_START_b1|
(content)
|SHOW_ON_SWITCH_INSIDE_CASE_END_b1|
In this example |USER_LEVEL| and |USER_GENDER| are the names of the field for which the switch is made, a and b are the prefixes, 0 and 1 are the possible values the names (|USER_LEVEL| and |USER_GENDER|) can take.
Resolve some special characters used inside values, like | and ( or )
Function: |KE_GENERIC_SWITCH_CONTENT(name,_coma_delimited_list_)|
Available keywords:
- |SHOW_ON_SWITCH_CASE_CONTENT_START_keyword|
- |SHOW_ON_SWITCH_CASE_CONTENT_END_keyword|
- |HIDE_ON_SWITCH_CASE_CONTENT_START_keyword|
- |HIDE_ON_SWITCH_CASE_CONTENT_END_keyword|
Add a comment
Comments
pFCHkVvrjgdrbhwCR