Developer manual
attribute
Dynamically add an attribute to the parent tag
Updated: Type: springtag
Method
<attribute option="value"></attribute>
Current
Request Attributes
Attribute | Type | Description | Default | Required? | |
---|---|---|---|---|---|
current | id | string | The name of the attribute to add to the parent tag | Yes |
Examples
#1
Request
<h1> <attribute id="class">myclass</attribute> My Title </img>
Add a simple attribute to the parent tag
Response
<h1 class="myclass">My Title</h1>
#2
Request
<img> <attribute id="src">/upload/pages/<copy id="pageid"/>/<copy id="image"/></attribute> <attribute id="alt"> <copy id="title"/> </attribute> <attribute id="id">productimage</attribute> </img>
Add multiple dynamic attributes to the parent tag
Response
<img src="/upload/pages/mypageid/myimage.jpg" alt="My Page Title" id="productimage"/>