Page tree

EUI Method Reference

This topic lists common methods used in the EUI. See Macros, Methods, and Conditionals for more information on using methods.

Methods

Methods are ways of checking conditions, making decisions, and retrieving information. For more information about using methods, particularly with conditionals, see Conditionals and Methods.

ewUser.isInGroup

$ewUser.isInGroup("group name")

Use this method to check the current user's group membership.

Parameter NameDescription
group nameThe name of the group to which the user might belong. Separate multiple group names with commas.

ewUser.isInTeam

$ewUser.isInTeam("team name")

Use this method to check the current user's team membership.

Parameter NameDescription
team nameThe name of the team to which the user might belong. Separate multiple team names with commas.

ewUser.getCurrentUserLogin

$ewUser.getCurrentUserLogin()

Use this method to return the current user's login.

Parameter NameDescription
[empty]Returns the login name of the current user.

ewUser.getCurrentUserFirstName

$ewUser.getCurrentUserLogin()

Use this method to return the current user's first name or login.

Parameter NameDescription
[empty]Returns the user's first name or the user's login if the First Name field is empty.

ewUser.getCurrentUserField

$ewUser.getCurrentUserField("field name")

Use this method to return a field value from the current user's record.

Parameter NameDescription
field nameThe field name in the user's record. For example, you might use "Welcome $ewUser.getCurrentUserField("full_name")!"

ewUtils.thisProjectLabel

$ewUtils.thisProjectLabel()

Use this method to return the label of the knowledgebase.

Parameter NameDescription
[empty]Returns the knowledgebase label.

ewUtils.thisProjectName

$ewUtils.thisProjectName()

Use this method to return the name of the knowledgebase.

Parameter NameDescription
[empty]Returns the knowledgebase name.

ewResponse.nocache

$ewResponse.nocache()

Use this method to instruct the response header not to cache the template.

Parameter NameDescription
[empty]Returns the knowledgebase name.

ewResponse.cache

$ewResponse.cache("time")

Use this method to instruct the response header to cache the template for a specified time in minutes.

Parameter NameDescription
timeThe number in minutes that the template is cached.

ewPermission.table

$ewPermission.table("table name","permission type")

Use this method to check the current user's permissions for a given table.

Parameter NameDescription
table nameThe logical table name to which the permission refers. The logical table name is found on the General tab of the Table wizard and may be different from the table name displayed on the left pane
permission typeThe type of permission the user may have on the specified table. For a complete list of possible permissions, see Permissions and Visibility in the EUI.

ewText.get

$ewText.get("key")

Use this method to reference values from translation.properties, either for displaying text on the EUI or retrieving values for conditionals.

Parameter NameDescription
keyThe variable from translation.properties. For more information on using this method, see translation.properties in the EUI Template Reference.

  • No labels