Development > Safe X3 WAS > Tokens > Conditioned blocks 

SEEWARNING 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

SEEREFERTTO Refer to documentation Implementation

Screen management

Header

Fields

The following fields are present on this tab :

  • Site (field FCYLIB)

Current Web site

  • Description (field INTIT)

 

Close

 

Tab General

Fields

The following fields are present on this tab :

Properties

  • field WA

 

  • Display bloc (field WHNACT)

  • When ticked, this box makes it possible to display the content of a conditioned block token if the condition is verified.

  • When the box is not ticked, the content of the conditioned block token is hidden if the condition is verified.

  • Criteria type (field WHNTYP)

Criteria type for the condition display/hide.
The other parameters depend on the Criteria type chosen:

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:

  • ADISPMAINEMPTY : Displays the HTML code if the main block AMAIN is empty.
  • AHIDEMAINEMPTY : Hides the HTML code if the main block AMAIN is empty.

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.

  • AHIDEMAINFIRSTPAGE : Hides the HTML code if the block AMAIN is on the 1st page.
  • AHIDEMAINLASTPAGE : Hides the HTML code if the block AMAIN is on the last 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.

  • ADISPUSERLOGGEDIN : Displays the HTML code if the User is logged in.
  • AHIDEUSERLOGGEDIN : Hides the HTML code if the User is logged in.

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.

  • ADISPSTAMPEMPTY : Displays the HTML code if the thumbnail is empty.
  • AHIDESTAMPEMPTY : Hides the HTML code if the thumbnail is empty.

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.

  • ADISPMAINSELECT : Displays the HTML code if the main block AMAIN of the page has a selected line.
  • AHIDEMAINSELECT : Hides the HTML code if the main block AMAIN of the page has a selected line.

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:

  • ADISPSAMEPAGE : Displays the HTML code if this is the same page as the one displayed.
  • AHIDESAMEPAGE : Hides the HTML code if this is the same page as the one displayed.

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">
<input type="button" value="Authentification with cookie" adx="ADLKSWITCHCOOKIES">   
<!adx="ADISPNOCOOKIES">
<!adx="ADISPNOCOOKIES:xnot">
<input type="button" value="Authentification without cookie" adx="ADLKSWITCHCOOKIES">
<!adx="ADISPNOCOOKIES">

HTML parameter
Only the xnot parameter is accepted to reverse the condition.
Hide instead of display and conversely.

Characteristics

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:

  • First page : the block is located in the first page.

  • Last page : the block is located in the last page.

  • Other page : The block is located in a page other than the first and last.

Code of the dynamic link of the Criteria type is set to "Last dynamic link used".

Code of the Web page if the Criteria type is set to "Previous page".

Website profiles

XTEND profile codes if the Criteria type is set to "Profile".

Close

 

Tab Selection

Presentation

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.

 

Fields

The following fields are present on this tab :

Formula synthesis

  • field RES50

 

Grid Formula

  • And/or (field ANDOR50)
  • ( (field BRKLFTM50)

 

  • Field (field VFIEKEY50)
  • field OPE50
  • Source (field VALTYP50)

  • Constant : fixed value entered in the next column.

  • Field Token : value of a block field whose names are entered in the next columns.

  • Web field: value of a field of an HTML form whose name is entered in the next column.

  • Web const./alloc. (field VALEUR50)

 

  • 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

This button is used to update the XTEND dictionary in XML format.

The X3WEB server takes into account only the dictionary with this format.

There is one XML file per dictionary.

For instance, the ACT.xml file corresponds to all the web actions for the current web site.

This button is used to copy a conditioned block.

Error messages

The only error messages are the generic ones.

Tables used

SEEREFERTTO Refer to documentation Implementation