Skip to main content

HTL Sightly

 HTL Sightly or HTML Template Language 

Templating language developed by Adobe
Used for developing AEM components
Integration of presentation logic and business logic

HTL Consist of 

i). Expression language: Used to insert pieces of content into the rendered markup.
ii). Block statements : Used to define statements over blocks of markup (conditions/iterations)

HTL code compiled into Java Servlets, during this process the expressions and the HTL Block data attributes are both evaluated entirely server-side, thus the view source option of HTML page does not show anything.

HTL Syntax


As we already seen There are 2 types of HTL Syntax.

Block statement & Expression language

Block Statement

Block statements are prefixed with data-sly.

Below given the block statements.
HTL sly-test
HTL sly-use
HTL sly-unwrap
HTL sly-text
HTL sly-attribute
HTL sly-element
HTL sly-repeat
HTL sly-list
HTL sly-resource
HTL sly-include
HTL sly-template
HTL sly-call

Expression Language
HTL expressions are evaluated at run time and their value is injected into the outgoing HTML stream.
HTL expressions are delimited by characters ${ and }.

Below given the Expression Languages.

HTL Variables
HTL Literals(Boolean, Number,Strings,Arrays)
HTL Operators(Logical Operators,Conditional (ternary) Operator, Comparison Operators, Grouping parentheses)
HTL Options(String Formatting,Internationalization,Array Join,Display Context)

The expression syntax includes variablesliteralsoperators and options:

Variables 

Variables are containers that store data values or objects. The names of variables are called identifiers.


Comments

Popular posts from this blog

OSGI

 OSGI Annotation Mapping to OSGi Declarative Services Annotations The below table gives you an overview of how to map the annotations. Annotation Mapping APACHE FELIX SCR ANNOTATION DESCRIPTION OSGI DECLARATIVE SERVICES ANNOTATION DESCRIPTION @Component The @Component annotation marks a Java class to be used as a component. @Component This is more or less a strict one-to-one replacement. Only difference is the default behavior for services. See below. @Service Marks the component as a service and optionally lists the provided services (classes) @Component The OSGi annotation has a service attribute which should be used to list the provided services. Be careful, if your component should not provide any service, set this attribute to an empty array. @Reference Reference to services, can be used on unary fields or on class level with bind/unbind methods. @Reference Field references can directly be migrated, for event based references (methods), the @Reference annotation must be p...

Akamai CDN

  Leveraging Akamai CDN for Enterprise Applications: Features and Benefits Leveraging Akamai CDN for Enterprise Applications: Features and Benefits Table of contents • Introduction • Features of Akamai CDN • Benefits of Akamai CDN • Use Cases of Akamai CDN • Akamai CDN vs Traditional CDN • How to Choose the Right CDN for Your Enterprise Application? • Conclusion Introduction What is a Content Delivery Network (CDN)? It's like having a team of roadies who transport your equipment from one gig to another, making sure everything arrives safely and on time. In the digital world, a CDN does the same thing for website content, delivering it from server to server so that it reaches the end user quickly and efficiently. And when it comes to CDNs, Akamai is definitely the Mick Jagger of the industry. With its cloud-based technology, high-performance content delivery, advanced security, and real-time analytics, Akamai CDN offers an impressive package of features that's hard to beat. So...

future of artificial intelligence

A new wave of artificial intelligence breakthroughs is making it possible for technology to do all sorts of things we at first can't believe and then quickly take for granted. That's making our lives easier and more productive, and it's also raising a new round of excitement and angst about where artificial intelligence is headed. "Right now we're in a phase of very fast advances, and that may well continue for a small number of years," said Christopher Bishop, a distinguished scientist with Microsoft Research Cambridge. With advances in machine learning, including deep neural networks and probabilistic models, computers can now instantly translate spoken and written conversation, recognize and accurately caption photos, identify faces and be your personal assistant. And yet, although they can do some individual tasks as well as or even better than humans, technology still cannot approach the complex thinking that humans have. "It's a long way fro...