Showing posts with label Sightly. Show all posts
Showing posts with label Sightly. Show all posts

Monday, April 17, 2017

AEM 6 Sightly

AEM 6 Sightly



Notes :
  • Sightly pages are written in HTL which is HTML template language. 
  • HTL is made simple so that it is easy to use by web developers as well as backend developers.
  • HTL makes use of HTML5
  • HTL pages are compiled as java serlvets and it is evaluated at server side. 
  • HTL is capable of applying proper context to the data which means it is more secure than JSP.
  • HTL can include a jsp file 
  • HTL block statements can not be defined inside script, style or html comments.
  • Context aware escaping that saves from cross site scripting attacks.
  • Javascript USE api is evaluated by serverside javascript engine.
  • HTL removes empty elements automatically
Block Statements :
  • data-sly-use
  • data-sly-unwrap
  • data-sly-call
  • data-sly-template
  • data-sly-text
  • data-slty-attribute
  • data-sly-test
  • data-sly-list
  • data-sly-resource
  • data-sly-include
Expressions :
  • ${name}
  • ${currentPage.title} or ${currentPage["title"]} or ${currentPage['title']}
  • ${true} or {false}
  • ${45}
  • ${"test"}
  • ${[1,2,3,4]}
  • ${array[1]}
  • ${!true}
  • ${ a > b}
  • ${a && b}
  • ${a || b }
  • ${ a < b ? a : b }
  • ${a == b}
  • ${a != b}
  • ${a @ test='test'}
  • $ {['a','b'] @ join=", "}





Monday, November 23, 2015

AEM Multilingual Contents in Sightly


AEM Multilingual Contents in Sightly

There are two ways one can configure multilingual contents on AEM using Multisite Management.

1. Blueprints
2. Language Copy

A blueprint is the source for creating multiple contents with the same format. Say for example we have a site in English, French and German. All these sites have similar contents in three different languages. We can configure blueprint keeping English site as the source and create French and German live copies. Now there should be dictionaries configured as per https://docs.adobe.com/docs/en/aem/6-0/develop/components/i18n/translator.html

To enable the multilingual contents  your sightly pages to use the content key as follows.

${'your_internationalization_key_as_per_i18n_file' @ i18n}
Here the locale/language is selected as per the language of contents

${'your_internationalization_key_as_per_i18n_file' @ i18n, source='user'}
In this syntax the language is selected from the browser setting of the user.

${'your_internationalization_key_as_per_i18n_file' @ i18n, locale='de'}
In this syntax  the language is de (German) taken from the locale value assigned.

Some more AEM 6 Interview Questions for Architects

 Some more AEM 6 Interview Questions for Architects 1. Consider you have a workflow with two steps. One step is to transfer the asset from s...