Appendix: Wrap-around Element Types
Wrap-around elements are used to contain other sections of markup, resulting in a conditional change to the behaviour of that markup.
The syntax of a wrap-around element tag consists of an opening tag, followed by the content you want to affect, followed by a closing tag, as shown below:
<%= ELEMENTNAME(Parameter1,Parameter2,...) %>
...some other markup...
<%= %>
The following table contains a complete list of wrap-around elements available to KnowledgeKube applications, including a brief description of each one's purpose and a link to further information you may need to implement it:
Element Name | Description | Sample Markup | Further Reading |
---|---|---|---|
Is Authenticated | The affected markup will only be visible if the current user is logged into your application. | <%= ISAUTHENTICATED() %> <p>Thank you for logging in!</p> <%= %> | Appendix: Changing Content Visibility According to User Type |
Is In Role | The opening tag contains the names of one or more valid User Roles (separated by commas if more than one is used). The affected markup will only be visible if the current user has at least one of the specified roles assigned to them. | <%= ISINROLE(Admin) %> <p>This text is for admins only!</p> <%= %> | Appendix: Changing Content Visibility According to User Role |
Is Release Version | The opening tag contains either the word Live or the word Preview. The affected markup will only be processed if the active release flag for the current page is set to the value specified. |
<%= ISRELEASEVERSION(Preview) %> <p>When viewing the live version of the site, this paragraph will be replaced by a table of product data.</p> |
Appendix: Changing Content Visibility Based on Release Version |
Is True | The opening tag contains a fully-formed Expression. The affected markup will only be displayed if the result of the expression is True. | <%= ISTRUE(RemainingTries > 0) %> <p>You still have remaining tries!</p> <%= %> | Appendix: Changing Content Visibility Using an Expression |
Is Not Authenticated | The affected markup will only be visible if the current user is not logged into your application. | <%= ISNOTAUTHENTICATED() %> <p>Please log in to proceed.</p> <%= %> | Appendix: Changing Content Visibility According to User Type |
Is Not In Role | The opening tag contains the names of one or more valid User Roles (separated by commas if more than one is used). The affected markup will only be visible if the current user has none of the specified roles assigned to them. | <%= ISNOTINROLE(Visitors,Support) %> <p>This text will be hidden from visitors and support staff.</p> <%= %> | Appendix: Changing Content Visibility According to User Role |
Is Not Released Version | The opening tag contains either the word Live or the word Preview. The affected markup will only be processed if the active release flag for the current page is not set to the value specified. | <%= ISNOTRELEASEVERSION(Live) %> <p>Demo content - will not appear on the live site!</p> <%= %> |
Appendix: Changing Content Visibility Based on Release Version |
Is Not True | The opening tag contains a fully-formed Expression. The affected markup will only be displayed if the result of the expression is not True. | <%= ISNOTTRUE(ServerStatus = "Online") %> <p>The server is not currently online. Please contact an administrator.</p> <%= %> | Appendix: Changing Content Visibility Using an Expression |