Conditioned block
Before creating your site, it is advised to read the documentation:Before beginning.
The token 'Conditioned block' makes it possible to manage the dynamic display of the content of HTML pages as a function of criteria defined by setup.
For instance: modifying the content of an HTML menu taking into account whether the user is logged in or not.
To do so, the token 'Conditioned block is inserted in the HTML page, just as for the token Blocks.
During the dynamic generation of the page, the XTEND engine evaluates the condition (logical expression) associated with the token:
- If the evaluation is verified: the 'child' tokens of the block (tokens delineated by the start and end of the block) are carried out to generate the HTML code corresponding to the block.
- If the condition is not verified: the 'child' tokens of the block are not taken into account and the HTML code is not displayed.
For a token hiding to HTML code instead of displaying it, the principle is the same.
The HTML setup 'xnot' indicates that the reverse condition must be evaluated, that is: hiding the HTML code instead of displaying it:
<!--Conditioned sections-->
<!adx="ADISPUSERLOGGEDIN">
<!--HTML code displayed if the user is logged in'-->
<!adx="ADISPUSERLOGGEDIN">
<!--Reverse conditioned sections-->
<!adx="ADISPUSERLOGGEDIN:xnot">
<!--HTML code displayed if the user is not logged in'-->
<!adx="ADISPUSERLOGGEDIN">
Prerequisites
Refer to documentation Implementation
Screen management
Header
Code (field BLCWHNCOD) |
Site (field FCYLIB) |
Current Web site |
Description (field INTIT) |
Tab General
Properties
field WA |
Display bloc (field WHNACT) |
|
Criteria type (field WHNTYP) |
Criteria type for the condition display/hide. Formula : the condition is verified if the evaluation of the formula is true. Empty block : the condition is verified if the block is empty. The standard tokens below evaluate the main block (AMAIN) of the page:
The token AHIDEMESSEMPTY hides the HTML code if a User message was sent by the Web service. Paging of a block : the condition is verified if the number of the current block page is equal to the parameter entered. The standard tokens below evaluate the main block (AMAIN) of the page.
Dynamic link used : the condition is verified if the code of the token 'Dynamic link' on which the User clicked to display the page is equal to the entered code. Previous page : the condition is verified if the code of the original page preceding the displayed page is equal to the entered code of the Web page. User logged in: the condition is verified if the User is logged in. The tokens below are supplied with the ASAMPLE site.
Profile : the condition is verified if the User is logged in and if the XTEND profile of this User is equal to one of the profils in the list (5 at a maximum). Empty thumbnail : the condition is verified if the current thumbnail (Specific Token ASTAMP) is empty. The tokens below are supplied with the ASAMPLE site.
Selected line : the condition is verified if the block has a selected line. The standard tokens below evaluate the main block (AMAIN) of the page.
Current page : the condition is verified if the displayed page is the current page, that is the same page as the one on which the User clicked. The tokens below are supplied as standard:
Authentication with or without cookies: the token ADISPNOCOOKIES is reserved and displays the HTML code if the User deactivated the use of cookie JSESSIONID for Session Authentication via dynamic link ADLKSWITCHCOOKIES and XTEND action ASESSSWITCHCOOKIES. <!adx="ADISPNOCOOKIES"> HTML parameter |
Characteristics
Block (field BLCCOD) |
Code of the block if the Criteria type is: Empty Block, Paging of a Block, Selected line. |
Pagination criteria (field BLCPAG) |
This field can be entered if the Criteria type is set to "Paging of a block". The condition is verified if the number of the current block page is equal to the parameter entered:
|
Dynamic link (field DLKCOD) |
Code of the dynamic link of the Criteria type is set to "Last dynamic link used". |
Web page (field PAGCOD) |
Code of the Web page if the Criteria type is set to "Previous page". |
Website profiles
Web site profile (field PRFCOD) |
XTEND profile codes if the Criteria type is set to "Profile". |
Tab Selection
Formula
The condition is verified if the evaluation of the formula is true.
The Formula block is used to enter the logical expression to be evaluated.
- Operand no.1 is of type 'MonBloc.MonChamp'.
- The entry of the value of operand no.2 is identical to that of the selection criteria of action setups.
Formula synthesis
field RES50 |
Grid Formula
And/or (field ANDOR50) |
( (field BRKLFTM50) |
Block (field VBLCCOD50) |
Block entity (field ZENTCOD50) |
Field (field VFIEKEY50) |
field OPE50 |
Source (field VALTYP50) |
|
Web const./alloc. (field VALEUR50) |
Block (field VBLCCOD50A) |
Block entity (field ZENTCOD50A) |
Field (field VFIEKEY50A) |
) (field BRKRGTM50) |
Reports
By default, the following reports are associated with this function :
PRTSCR : Screen print
This can be changed using a different setup.
Specific Buttons
Copy |
This button is used to copy a conditioned block. |