ePages 6.13.2 - DE_EPAGES/Presentation/API/TLE/MenuHandler.pm

Package DE_EPAGES::Presentation::API::TLE::MenuHandler

Implements the TLE block "MENU".

Functions

MENU
MENU_COUNT
MENU_ID
MENU_JSON

MENU

Use this statement to display the content of a menu. The following TLE variables are available inside the menu block:

If the menu is associated with an action, then the following additional variables are available:

Syntax
#MENU(#Name, #Separator) ... #ENDMENU
old syntax:
#BLOCK("MENU", #Name, #Separator) ... #ENDBLOCK
Example
#IF( #MENU_COUNT("Tabs") > 0 )
  <ul>
  #MENU( "Tabs", "|" )
    <li>#INCLUDE(#Template)</li>
  #ENDMENU
  </ul>
#ENDIF
Input
#Name (string)
name of a menu
#Separator (string
# no critic (RequireCommentForExportedFunctions))
(optional) separator between menu items

MENU_COUNT

Returns the number of items in a menu.

Syntax
#MENU_COUNT(#Name)
Example
#MENU_COUNT("Tabs")
Input
#Name (string
# no critic (RequireCommentForExportedFunctions))
name of a menu

MENU_ID

Returns the identifier of a menu.

Syntax
#MENU_ID(#Name)
Example
#MENU_ID("Tabs")
Input
#Name (string
# no critic (RequireCommentForExportedFunctions))
name of a menu

MENU_JSON

Use this statement to get the content of a json menu.

Syntax
#MENU_JSON(#Name, #HashName, #FromJSON)
Example
<ul>
#LOOP( #MENU_JSON("BatchActions", "", 1) )
  <li><a href="#Action">#Name</a></li>
#ENDLOOP
</ul>
#LOCAL( "BatchMenu", "" )
#SET( "BatchMenu", #FROM_JSON(#MENU_JSON( "BatchActions", "")) )
<ul>
#LOOP( #BatchMenu )
  <li><a href="#Action">#Name</a></li>
#ENDLOOP
</ul>
#ENDLOCAL
#LOCAL( "BatchMenu", "" )
#SET( "BatchMenu", #MENU_JSON("BatchActions", "Items", 1) )
<ul>
#LOOP( #BatchMenu.Items )
  <li><a href="#Action">#Name</a></li>
#ENDLOOP
</ul>
#ENDLOCAL
Input
#Name (string)
name of a menu
#HashName (string)
key name of menu array, if HashName empty results an array
#FromJSON (boolean
# no critic (RequireCommentForExportedFunctions))
an indication whether to result an object instead of the json string