SlideShare a Scribd company logo
Introduction to Sightly
(By Ankit Gubrani)
Introduction to Sightly
Agenda :
lWhat is sightly ?
lWhy sightly ?
lsightly Expression Language
lsightly Data Attributes
What is sightly ?
Sightly is the new HTML templating system, introduced with
AEM 6.0. It is a new templating engine for apache sling.
Why sightly ?
WHY?!?!
Don't Mess with my Markup
lFirst reason would be to keep my presenstation logic away from my business logic.
lsightly is HTML5: A Sightly template is itself a valid HTML5 file.
lSecurity by Default : Sightly automatically filters and escapes all text
lbeing output to the presentation layer to prevent cross-site-scripting
lvulnerabilties.
But hey ! Why not any other template engine ?
lNo Other templating system forces developer to keep
lmarkup (Presentation) saperate from code (Business logic)
lAny other templating engine would not proivde felixibility to
luse extensive features of JCR.
lAny other templating engine would not provide felixibility
lto use SLING.
Current Scenario
After sightly
sightly Expression Language
lsightly expressions are delimited by characters ${ and }. At
l runtime, these expressions are evauated and their value is
l injected into the outgoing HTML stream. They can occur
lwithin the HTML text or within attribute values.
l Sample Code :
l <h1>Page Title</h1>
l <p>${currentPage.Title}</p>
lsightly expressions are used to access the data structures that
l provide the dynamic elements of the HTML output.
List of some useful objects available
lProperties
lpageProperties
lComponent
lcurrentDesign
lcurrentPage
llog
lout
lpageManager
lrequest
lresource
lresponse
lsling
lwcmmode
DEMO
sightly Data Attributes
To define structural elements within the template Sightly
employs the HTML data attribute, which is an HTML5
attribute syntax purposely intended for custom use by
third-party applications. All sightly-specific attributes are
prefixed with data-sly-
data-sly-list: Repeats the content of the host element for each enu
<ul data-sly-list="${currentPage.listChildren}">
<li>index: ${item.path}</li>
</ul>
List
Test
data-sly-test: Conditionally removes the host element and it's conte
<p data-sly-test.abc="${a || b || c}">is true</p>
<p data-sly-test="${!abc}">or not</p>
Use
data-sly-use: Initializes a helper object (defined in JavaScript or J
<div data-sly-use.nav="Navigation">${nav.foo}</div>
DEMO
Any Questions?
Introduction to Sightly
lAbout Me
.about-me{
name: Ankit Gubrani !Sr. AEM Developer;
email-id: ankit.gubrani@codebrains.co.in;
LinkedIn: in.linkedin.com/in/ankitgubrani;
twitter: @ankitgubrani90;
blog: codebrains.blogspot.in;
website : codebrains.co.in;
}
Thank You
Please contact me at : ankit.gubrani@codebrains.co.in

More Related Content

What's hot (20)

PPTX
HTL(Sightly) - All you need to know
Prabhdeep Singh
 
PPTX
Sling Models Overview
Justin Edelson
 
PPTX
Spring boot
Pradeep Shanmugam
 
PPTX
Sightly - Part 2
Prabhdeep Singh
 
PPTX
Spring boot Introduction
Jeevesh Pandey
 
PPTX
Getting Started with Lightning Web Components | LWC | Salesforce
Rahul Malhotra
 
PDF
Clean architectures with fast api pycones
Alvaro Del Castillo
 
PDF
Microservice With Spring Boot and Spring Cloud
Eberhard Wolff
 
PDF
Spring Security
Knoldus Inc.
 
PPTX
AEM - Client Libraries
Prabhdeep Singh
 
PDF
Introduction to JWT and How to integrate with Spring Security
Bruno Henrique Rother
 
PDF
Spring Boot Interview Questions | Edureka
Edureka!
 
PPTX
Sling models by Justin Edelson
AEM HUB
 
PPTX
An Introduction to Maven
Vadym Lotar
 
PPTX
Spring boot - an introduction
Jonathan Holloway
 
PPTX
Osgi
Heena Madan
 
PPTX
Hibernate ppt
Aneega
 
PDF
Introduction to Spring Boot!
Jakub Kubrynski
 
PDF
What Is Spring Framework In Java | Spring Framework Tutorial For Beginners Wi...
Edureka!
 
PDF
Modernizing Adobe Experience Manager (AEM)
Gabriel Walt
 
HTL(Sightly) - All you need to know
Prabhdeep Singh
 
Sling Models Overview
Justin Edelson
 
Spring boot
Pradeep Shanmugam
 
Sightly - Part 2
Prabhdeep Singh
 
Spring boot Introduction
Jeevesh Pandey
 
Getting Started with Lightning Web Components | LWC | Salesforce
Rahul Malhotra
 
Clean architectures with fast api pycones
Alvaro Del Castillo
 
Microservice With Spring Boot and Spring Cloud
Eberhard Wolff
 
Spring Security
Knoldus Inc.
 
AEM - Client Libraries
Prabhdeep Singh
 
Introduction to JWT and How to integrate with Spring Security
Bruno Henrique Rother
 
Spring Boot Interview Questions | Edureka
Edureka!
 
Sling models by Justin Edelson
AEM HUB
 
An Introduction to Maven
Vadym Lotar
 
Spring boot - an introduction
Jonathan Holloway
 
Hibernate ppt
Aneega
 
Introduction to Spring Boot!
Jakub Kubrynski
 
What Is Spring Framework In Java | Spring Framework Tutorial For Beginners Wi...
Edureka!
 
Modernizing Adobe Experience Manager (AEM)
Gabriel Walt
 

Similar to Introduction to Sightly (20)

PDF
Html5 tutorial
Jesus Cortes
 
PDF
Html5 - Tutorial
adelaticleanu
 
PDF
html5 _ Fundamentals a Basic Concepts of Understanding HTML.pdf
HusnianIlyas
 
PDF
Frontend Interview Questions PDF By ScholarHat
Scholarhat
 
PDF
Html5 deciphered - designing concepts part 1
Paxcel Technologies
 
PDF
Html5 tutorial
Ali Haydar(Raj)
 
PDF
Html5 tutorial
Edress Oryakhail
 
PDF
Html5 tutorial
Arjuman Shaikh
 
PDF
Html5 tutorial
Jitendra Gangwar
 
PDF
Html5 tutorial
Divyesh Bharadava
 
PPT
Html
bichhu
 
PPT
Silverlight 2 for Developers - TechEd New Zealand 2008
Jonas Follesø
 
PDF
Moduarlity patterns with OSGi
Paul Bakker
 
PPTX
Bootcamp - Web Development Session 2
GDSCUniversitasMatan
 
PPTX
Web components
Mohd Saeed
 
PDF
HTML literals, the JSX of the platform
Kenneth Rohde Christiansen
 
PDF
Salesforce Auckland Developer Meetup - May 2018 - Lightning Web Components
Ben Edwards
 
PDF
Sitepoint.com a basic-html5_template
Daniel Downs
 
PPTX
CAP 756 UNIT 1.pptx
vahidullahahmed
 
PPTX
Introduction to Sightly and Sling Models
Stefano Celentano
 
Html5 tutorial
Jesus Cortes
 
Html5 - Tutorial
adelaticleanu
 
html5 _ Fundamentals a Basic Concepts of Understanding HTML.pdf
HusnianIlyas
 
Frontend Interview Questions PDF By ScholarHat
Scholarhat
 
Html5 deciphered - designing concepts part 1
Paxcel Technologies
 
Html5 tutorial
Ali Haydar(Raj)
 
Html5 tutorial
Edress Oryakhail
 
Html5 tutorial
Arjuman Shaikh
 
Html5 tutorial
Jitendra Gangwar
 
Html5 tutorial
Divyesh Bharadava
 
Html
bichhu
 
Silverlight 2 for Developers - TechEd New Zealand 2008
Jonas Follesø
 
Moduarlity patterns with OSGi
Paul Bakker
 
Bootcamp - Web Development Session 2
GDSCUniversitasMatan
 
Web components
Mohd Saeed
 
HTML literals, the JSX of the platform
Kenneth Rohde Christiansen
 
Salesforce Auckland Developer Meetup - May 2018 - Lightning Web Components
Ben Edwards
 
Sitepoint.com a basic-html5_template
Daniel Downs
 
CAP 756 UNIT 1.pptx
vahidullahahmed
 
Introduction to Sightly and Sling Models
Stefano Celentano
 
Ad

More from Ankit Gubrani (8)

PPTX
Sling pipes
Ankit Gubrani
 
PPTX
Circuit breaker pattern
Ankit Gubrani
 
PDF
Sling models
Ankit Gubrani
 
PPTX
AEM integration with Apache Mahout
Ankit Gubrani
 
PDF
Content personalization in AEM
Ankit Gubrani
 
PDF
Integrating Apache Wookie with AEM || AEM-Wookie Connector Tool
Ankit Gubrani
 
PDF
Build Automation using Maven
Ankit Gubrani
 
PDF
AEM Client Context Customisation
Ankit Gubrani
 
Sling pipes
Ankit Gubrani
 
Circuit breaker pattern
Ankit Gubrani
 
Sling models
Ankit Gubrani
 
AEM integration with Apache Mahout
Ankit Gubrani
 
Content personalization in AEM
Ankit Gubrani
 
Integrating Apache Wookie with AEM || AEM-Wookie Connector Tool
Ankit Gubrani
 
Build Automation using Maven
Ankit Gubrani
 
AEM Client Context Customisation
Ankit Gubrani
 
Ad

Recently uploaded (20)

PDF
How Agentic AI Networks are Revolutionizing Collaborative AI Ecosystems in 2025
ronakdubey419
 
PPTX
Web Testing.pptx528278vshbuqffqhhqiwnwuq
studylike474
 
PDF
What companies do with Pharo (ESUG 2025)
ESUG
 
PDF
Protecting the Digital World Cyber Securit
dnthakkar16
 
PDF
Applitools Platform Pulse: What's New and What's Coming - July 2025
Applitools
 
PDF
Salesforce Pricing Update 2025: Impact, Strategy & Smart Cost Optimization wi...
GetOnCRM Solutions
 
PDF
Summary Of Odoo 18.1 to 18.4 : The Way For Odoo 19
CandidRoot Solutions Private Limited
 
PDF
Why Are More Businesses Choosing Partners Over Freelancers for Salesforce.pdf
Cymetrix Software
 
PPTX
Explanation about Structures in C language.pptx
Veeral Rathod
 
PDF
Infrastructure planning and resilience - Keith Hastings.pptx.pdf
Safe Software
 
PDF
Virtual Threads in Java: A New Dimension of Scalability and Performance
Tier1 app
 
PDF
advancepresentationskillshdhdhhdhdhdhhfhf
jasmenrojas249
 
PDF
Supabase Meetup: Build in a weekend, scale to millions
Carlo Gilmar Padilla Santana
 
PDF
How to Download and Install ADT (ABAP Development Tools) for Eclipse IDE | SA...
SAP Vista, an A L T Z E N Company
 
PDF
AI Image Enhancer: Revolutionizing Visual Quality”
docmasoom
 
PPTX
Role Of Python In Programing Language.pptx
jaykoshti048
 
PDF
SAP GUI Installation Guide for Windows | Step-by-Step Setup for SAP Access
SAP Vista, an A L T Z E N Company
 
PDF
Using licensed Data Loss Prevention (DLP) as a strategic proactive data secur...
Q-Advise
 
PDF
Step-by-Step Guide to Install SAP HANA Studio | Complete Installation Tutoria...
SAP Vista, an A L T Z E N Company
 
PDF
Balancing Resource Capacity and Workloads with OnePlan – Avoid Overloading Te...
OnePlan Solutions
 
How Agentic AI Networks are Revolutionizing Collaborative AI Ecosystems in 2025
ronakdubey419
 
Web Testing.pptx528278vshbuqffqhhqiwnwuq
studylike474
 
What companies do with Pharo (ESUG 2025)
ESUG
 
Protecting the Digital World Cyber Securit
dnthakkar16
 
Applitools Platform Pulse: What's New and What's Coming - July 2025
Applitools
 
Salesforce Pricing Update 2025: Impact, Strategy & Smart Cost Optimization wi...
GetOnCRM Solutions
 
Summary Of Odoo 18.1 to 18.4 : The Way For Odoo 19
CandidRoot Solutions Private Limited
 
Why Are More Businesses Choosing Partners Over Freelancers for Salesforce.pdf
Cymetrix Software
 
Explanation about Structures in C language.pptx
Veeral Rathod
 
Infrastructure planning and resilience - Keith Hastings.pptx.pdf
Safe Software
 
Virtual Threads in Java: A New Dimension of Scalability and Performance
Tier1 app
 
advancepresentationskillshdhdhhdhdhdhhfhf
jasmenrojas249
 
Supabase Meetup: Build in a weekend, scale to millions
Carlo Gilmar Padilla Santana
 
How to Download and Install ADT (ABAP Development Tools) for Eclipse IDE | SA...
SAP Vista, an A L T Z E N Company
 
AI Image Enhancer: Revolutionizing Visual Quality”
docmasoom
 
Role Of Python In Programing Language.pptx
jaykoshti048
 
SAP GUI Installation Guide for Windows | Step-by-Step Setup for SAP Access
SAP Vista, an A L T Z E N Company
 
Using licensed Data Loss Prevention (DLP) as a strategic proactive data secur...
Q-Advise
 
Step-by-Step Guide to Install SAP HANA Studio | Complete Installation Tutoria...
SAP Vista, an A L T Z E N Company
 
Balancing Resource Capacity and Workloads with OnePlan – Avoid Overloading Te...
OnePlan Solutions
 

Introduction to Sightly

  • 3. Agenda : lWhat is sightly ? lWhy sightly ? lsightly Expression Language lsightly Data Attributes
  • 5. Sightly is the new HTML templating system, introduced with AEM 6.0. It is a new templating engine for apache sling.
  • 7. Don't Mess with my Markup lFirst reason would be to keep my presenstation logic away from my business logic. lsightly is HTML5: A Sightly template is itself a valid HTML5 file. lSecurity by Default : Sightly automatically filters and escapes all text lbeing output to the presentation layer to prevent cross-site-scripting lvulnerabilties.
  • 8. But hey ! Why not any other template engine ?
  • 9. lNo Other templating system forces developer to keep lmarkup (Presentation) saperate from code (Business logic) lAny other templating engine would not proivde felixibility to luse extensive features of JCR. lAny other templating engine would not provide felixibility lto use SLING.
  • 13. lsightly expressions are delimited by characters ${ and }. At l runtime, these expressions are evauated and their value is l injected into the outgoing HTML stream. They can occur lwithin the HTML text or within attribute values. l Sample Code : l <h1>Page Title</h1> l <p>${currentPage.Title}</p> lsightly expressions are used to access the data structures that l provide the dynamic elements of the HTML output.
  • 14. List of some useful objects available lProperties lpageProperties lComponent lcurrentDesign lcurrentPage llog lout lpageManager lrequest lresource lresponse lsling lwcmmode
  • 15. DEMO
  • 17. To define structural elements within the template Sightly employs the HTML data attribute, which is an HTML5 attribute syntax purposely intended for custom use by third-party applications. All sightly-specific attributes are prefixed with data-sly-
  • 18. data-sly-list: Repeats the content of the host element for each enu <ul data-sly-list="${currentPage.listChildren}"> <li>index: ${item.path}</li> </ul> List
  • 19. Test data-sly-test: Conditionally removes the host element and it's conte <p data-sly-test.abc="${a || b || c}">is true</p> <p data-sly-test="${!abc}">or not</p>
  • 20. Use data-sly-use: Initializes a helper object (defined in JavaScript or J <div data-sly-use.nav="Navigation">${nav.foo}</div>
  • 21. DEMO
  • 24. lAbout Me .about-me{ name: Ankit Gubrani !Sr. AEM Developer; email-id: [email protected]; LinkedIn: in.linkedin.com/in/ankitgubrani; twitter: @ankitgubrani90; blog: codebrains.blogspot.in; website : codebrains.co.in; }