As of Aeon v5.0.3, you can use a "CompareValue" attribute with the <#TRANSACTION> and <#DATAROW> tags to configure web page content to display differently based on a selected database field value associated with a transaction.
Configuring the CompareValue Attribute
To use the CompareValue attribute, you must first add the CompareValue display parameter (display='CompareValue') to the <#TRANSACTION> or <#DATAROW> tag. The following parameters should then be added to the tag to configure the settings for the attribute and your desired display options:
Parameter Name | Description |
field |
Contains the name of the database field you want to check the transaction against. For example, field='ItemEdition' will check the ItemEdition field for the transaction. |
compareValue |
Contains the specific value in the selected field you want to check the transaction against. For example, compareValue='1' will check if the field selected in the field parameter for the transaction holds the value of '1'. |
disabledValue |
Holds the display option that will trigger if the value in the selected field for the transaction does not match the compareValue. For example, disabledValue='No' will display "No" if the transaction does not match the value set in the compareValue parameter. |
enabledValue |
Holds the display option that will trigger if the value in the selected field for the transaction matches the compareValue. For example, enabledValue='Yes' will display "Yes" if the transaction matches the value set in the compareValue parameter. |
The following fields cannot be used with the CompareValue attribute:
- Title, Author, TransactionStatus, PhotoduplicationStatus, TransactionStatusQueueId, PhotoduplicationStatusQueueId, CurrentCharges, RequestActionAllowed, and FileSize.
Examples
The following examples show two different ways the CompareValue attribute can be used to hide or display content on a web page:
Example 1: Hide Content Based on a Field Value
In this example, the content of a div would be hidden by making the class "d-none" if the transaction is not of type "Loan":
<div class="<#TRANSACTION display='CompareValue' field='RequestType'
compareValue='Loan' disabledValue='d-none'>">This is content</div>
Example 2: Display Different Content Based on a Field Value
In this example, if the ItemEdition field value for the transaction matches the compareValue of '1' then the enabledValue of "Yes" will show. Otherwise, the disabledValue of "No" will display:
Is the ItemEdition = 1? <#TRANSACTION display='CompareValue' field='ItemEdition'
compareValue='1' enabledValue='Yes' disabledValue='No'>