How to generate title into a class?
Hello,
I want to generate a title into a class. Example:
<div data-sly-list="${contents.sections}">
<p>${item.sectionTitle}</p>
<p>${item.sectionContent}</p>
<div class="${item.subSectionTitle}" data-sly-list="${item.subSectionField}">
<p>${item.subSectionTitle}</p>
<p>${item.subSectionContent}</p>
</div>
</div>
The class as "${item.subSectionTitle}" but if the subSectionTitle have a space, I want to replace the "space" with the "-".
Example: subSectionTitle = Sub section title , the class will be class="sub-section-title" or the class="sub"
How to do that?
Thank you so much,
Bien