A developer wants to render Hello World' only in edit mode. Which approach would be used?
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, the wcmmode object is used. The correct property to check if the current mode is edit is wcmmode.edit. The HTL syntax for testing a condition is data-sly-test followed 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 uses wcm.edit which is not the correct object property.
Option C uses wcmmode editor which is not the correct property and the syntax has a typo (should be data-sly-test).
Ivette
2 months agoDorcas
2 months agoHillary
23 days agoRobt
26 days agoErick
2 months agoMiles
2 months agoVivan
2 months agoLauran
2 months agoLuisa
1 months agoAlyssa
1 months agoFelton
2 months agoDwight
2 months agoHello World
Rory
3 months agoBulah
2 months agoLashaunda
2 months agoVivan
3 months agoHello World