Returns the raw attribute value identified by the specified attribute id.
Returns the raw attribute value identified by the specified attribute id. By raw attribute value we denote the unprocessed value as provided for the attribute driven by the type of the respective attribute definition:
boolean
-> booleancategory
-> string representing a catalog category IDcustom
-> Map that originates from a stringified curly brackets {} JSON objectcms_record
-> Map that originates from a stringified curly brackets {} JSON object whose entries must adhere to thecmsrecord.json
schemaenum
-> either string or integerfile
-> string representing a file path within a libraryimage
-> Map that originates from a stringified curly brackets {} JSON object whose entries must adhere to thecontent/schema/image.json
schemainteger
-> integermarkup
-> string representing HTML markuppage
-> string representing a page IDproduct
-> string representing a product SKUstring
-> stringtext
-> stringurl
-> string representing a URL
There is two places an attribute value can come from - either it was persisted at design time (e.g.
by the merchant by editing a component in Page Designer) or it was injected in shape of an aspect attribute at rendering time
through the execution of code. The persistent value, if existing, takes precedence over the injected aspect
attribute one. Injection of a value through an aspect attribute will only occur if the component attribute's
attribute definition was declared using the "dynamic_lookup"
property and its aspect attribute alias matches
the ID of the respective aspect attribute.
Accessing the raw value can be helpful if render and serialization logic of the component needs to operate on these unprocessed values. An unprocessed value might be fundamentally different from its processed counterpart, the latter being provided through the content dictionary (see ComponentScriptContext.getContent()) when the render/serialize function of the component is invoked.