I have a HTML snippet as below.
<div id="mydivid" class="abcd xyz myclass">
....
...
</div>
I have wrote it in below way. but it doesn't shows the entire dive in wcmmode=disabled.
<div data-sly-test.editor="${wcmmode.edit || wcmmode.design}">
<div id="mydivid" class="abcd xyz myclass">
</div>
....
...
<div data-sly-test.editor="${wcmmode.edit || wcmmode.design}">
</div>
</div>
Is there any way to add "myclass" value to the class attribute alone only in author mode and not in preview or disabled mode of AEM page.
HTL provides better flexibility to write test conditions which avoids using the JSTL style if conditions. Your code can be easily written as shown below
In case you don't want any classes in publish, then
The HTL specification for reference.