In AEM, the Sightly/HTL scripting language is used to develop robust and secure components. To render content conditionally based on the WCM (Web Content Management) mode, thewcmmodeobject is used. The correct property to check if the current mode is edit iswcmmode.edit. The HTL syntax for testing a condition isdata-sly-testfollowed by the condition in${}. The option B correctly uses this syntax to test if the WCM mode is edit, and if so, renders "Hello World".
Option A useswcm.editwhich is not the correct object property.
Option C useswcmmode editorwhich is not the correct property and the syntax has a typo (should bedata-sly-test).
Contribute your Thoughts:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit