SlideShare a Scribd company logo
Introduction to Sightly
(By Ankit Gubrani)
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?
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

Sling models by Justin Edelson
Sling models by Justin Edelson Sling models by Justin Edelson
Sling models by Justin Edelson AEM HUB
 
Sling Models Overview
Sling Models OverviewSling Models Overview
Sling Models Overview
Justin Edelson
 
Angular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP ServicesAngular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP Services
WebStackAcademy
 
Angular 8
Angular 8 Angular 8
Angular 8
Sunil OS
 
Angular
AngularAngular
Angular
Lilia Sfaxi
 
An Introduction to the DOM
An Introduction to the DOMAn Introduction to the DOM
An Introduction to the DOM
Mindy McAdams
 
Introduction to Javascript
Introduction to JavascriptIntroduction to Javascript
Introduction to Javascript
Amit Tyagi
 
Spring Boot Tutorial
Spring Boot TutorialSpring Boot Tutorial
Spring Boot Tutorial
Naphachara Rattanawilai
 
JavaScript - Chapter 11 - Events
 JavaScript - Chapter 11 - Events  JavaScript - Chapter 11 - Events
JavaScript - Chapter 11 - Events
WebStackAcademy
 
CSS Dasar #3 : Penempatan CSS
CSS Dasar #3 : Penempatan CSSCSS Dasar #3 : Penempatan CSS
CSS Dasar #3 : Penempatan CSS
Sandhika Galih
 
AEM (CQ) Dispatcher Security and CDN+Browser Caching
AEM (CQ) Dispatcher Security and CDN+Browser CachingAEM (CQ) Dispatcher Security and CDN+Browser Caching
AEM (CQ) Dispatcher Security and CDN+Browser Caching
Andrew Khoury
 
Introduction to Javascript
Introduction to JavascriptIntroduction to Javascript
Introduction to Javascript
Seble Nigussie
 
Introduction to html
Introduction to htmlIntroduction to html
Introduction to html
Himanshu Pathak
 
jQuery Tutorial For Beginners | Developing User Interface (UI) Using jQuery |...
jQuery Tutorial For Beginners | Developing User Interface (UI) Using jQuery |...jQuery Tutorial For Beginners | Developing User Interface (UI) Using jQuery |...
jQuery Tutorial For Beginners | Developing User Interface (UI) Using jQuery |...
Edureka!
 
Css3
Css3Css3
3. Java Script
3. Java Script3. Java Script
3. Java Script
Jalpesh Vasa
 
Java script
Java scriptJava script
Java script
Sadeek Mohammed
 
The Complete HTML
The Complete HTMLThe Complete HTML
The Complete HTML
Rohit Buddabathina
 

What's hot (20)

Sling models by Justin Edelson
Sling models by Justin Edelson Sling models by Justin Edelson
Sling models by Justin Edelson
 
Sling Models Overview
Sling Models OverviewSling Models Overview
Sling Models Overview
 
AEM - Client Libraries
AEM - Client LibrariesAEM - Client Libraries
AEM - Client Libraries
 
Angular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP ServicesAngular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP Services
 
Angular 8
Angular 8 Angular 8
Angular 8
 
Angular
AngularAngular
Angular
 
An Introduction to the DOM
An Introduction to the DOMAn Introduction to the DOM
An Introduction to the DOM
 
Introduction to Javascript
Introduction to JavascriptIntroduction to Javascript
Introduction to Javascript
 
Spring Boot Tutorial
Spring Boot TutorialSpring Boot Tutorial
Spring Boot Tutorial
 
JavaScript - Chapter 11 - Events
 JavaScript - Chapter 11 - Events  JavaScript - Chapter 11 - Events
JavaScript - Chapter 11 - Events
 
CSS Dasar #3 : Penempatan CSS
CSS Dasar #3 : Penempatan CSSCSS Dasar #3 : Penempatan CSS
CSS Dasar #3 : Penempatan CSS
 
AEM (CQ) Dispatcher Security and CDN+Browser Caching
AEM (CQ) Dispatcher Security and CDN+Browser CachingAEM (CQ) Dispatcher Security and CDN+Browser Caching
AEM (CQ) Dispatcher Security and CDN+Browser Caching
 
Introduction to Javascript
Introduction to JavascriptIntroduction to Javascript
Introduction to Javascript
 
Introduction to html
Introduction to htmlIntroduction to html
Introduction to html
 
jQuery Tutorial For Beginners | Developing User Interface (UI) Using jQuery |...
jQuery Tutorial For Beginners | Developing User Interface (UI) Using jQuery |...jQuery Tutorial For Beginners | Developing User Interface (UI) Using jQuery |...
jQuery Tutorial For Beginners | Developing User Interface (UI) Using jQuery |...
 
Css3
Css3Css3
Css3
 
Jquery
JqueryJquery
Jquery
 
3. Java Script
3. Java Script3. Java Script
3. Java Script
 
Java script
Java scriptJava script
Java script
 
The Complete HTML
The Complete HTMLThe Complete HTML
The Complete HTML
 

Similar to Introduction to Sightly

Html5 tutorial
Html5 tutorialHtml5 tutorial
Html5 tutorial
Jesus Cortes
 
Html5 deciphered - designing concepts part 1
Html5 deciphered - designing concepts part 1Html5 deciphered - designing concepts part 1
Html5 deciphered - designing concepts part 1
Paxcel Technologies
 
Html5 tutorial
Html5 tutorialHtml5 tutorial
Html5 tutorial
Arjuman Shaikh
 
Html5 tutorial
Html5 tutorialHtml5 tutorial
Html5 tutorial
Jitendra Gangwar
 
Html5 tutorial
Html5 tutorialHtml5 tutorial
Html5 tutorial
Edress Oryakhail
 
Html5 tutorial
Html5 tutorialHtml5 tutorial
Html5 tutorial
Divyesh Bharadava
 
Html5 tutorial
Html5 tutorialHtml5 tutorial
Html5 tutorial
Ali Haydar(Raj)
 
Silverlight 2 for Developers - TechEd New Zealand 2008
Silverlight 2 for Developers - TechEd New Zealand 2008Silverlight 2 for Developers - TechEd New Zealand 2008
Silverlight 2 for Developers - TechEd New Zealand 2008
Jonas Follesø
 
Moduarlity patterns with OSGi
Moduarlity patterns with OSGiModuarlity patterns with OSGi
Moduarlity patterns with OSGi
Paul Bakker
 
Bootcamp - Web Development Session 2
Bootcamp - Web Development Session 2Bootcamp - Web Development Session 2
Bootcamp - Web Development Session 2
GDSCUniversitasMatan
 
Web components
Web componentsWeb components
Web components
Mohd Saeed
 
HTML literals, the JSX of the platform
HTML literals, the JSX of the platformHTML literals, the JSX of the platform
HTML literals, the JSX of the platform
Kenneth Rohde Christiansen
 
Salesforce Auckland Developer Meetup - May 2018 - Lightning Web Components
Salesforce Auckland Developer Meetup - May 2018 - Lightning Web Components Salesforce Auckland Developer Meetup - May 2018 - Lightning Web Components
Salesforce Auckland Developer Meetup - May 2018 - Lightning Web Components
Ben Edwards
 
Sitepoint.com a basic-html5_template
Sitepoint.com a basic-html5_templateSitepoint.com a basic-html5_template
Sitepoint.com a basic-html5_templateDaniel Downs
 
CAP 756 UNIT 1.pptx
CAP 756 UNIT 1.pptxCAP 756 UNIT 1.pptx
CAP 756 UNIT 1.pptx
vahidullahahmed
 
Introduction to Sightly and Sling Models
Introduction to Sightly and Sling ModelsIntroduction to Sightly and Sling Models
Introduction to Sightly and Sling Models
Stefano Celentano
 
What is html xml and xhtml
What is html xml and xhtmlWhat is html xml and xhtml
What is html xml and xhtml
FkdiMl
 
Dsc Charusat Learning React Part 1
Dsc Charusat Learning React Part 1 Dsc Charusat Learning React Part 1
Dsc Charusat Learning React Part 1
JainamMehta19
 

Similar to Introduction to Sightly (20)

Html5 - Tutorial
Html5 - TutorialHtml5 - Tutorial
Html5 - Tutorial
 
Html5 tutorial
Html5 tutorialHtml5 tutorial
Html5 tutorial
 
Html5 deciphered - designing concepts part 1
Html5 deciphered - designing concepts part 1Html5 deciphered - designing concepts part 1
Html5 deciphered - designing concepts part 1
 
Html5 tutorial
Html5 tutorialHtml5 tutorial
Html5 tutorial
 
Html5 tutorial
Html5 tutorialHtml5 tutorial
Html5 tutorial
 
Html5 tutorial
Html5 tutorialHtml5 tutorial
Html5 tutorial
 
Html5 tutorial
Html5 tutorialHtml5 tutorial
Html5 tutorial
 
Html5 tutorial
Html5 tutorialHtml5 tutorial
Html5 tutorial
 
Html
HtmlHtml
Html
 
Silverlight 2 for Developers - TechEd New Zealand 2008
Silverlight 2 for Developers - TechEd New Zealand 2008Silverlight 2 for Developers - TechEd New Zealand 2008
Silverlight 2 for Developers - TechEd New Zealand 2008
 
Moduarlity patterns with OSGi
Moduarlity patterns with OSGiModuarlity patterns with OSGi
Moduarlity patterns with OSGi
 
Bootcamp - Web Development Session 2
Bootcamp - Web Development Session 2Bootcamp - Web Development Session 2
Bootcamp - Web Development Session 2
 
Web components
Web componentsWeb components
Web components
 
HTML literals, the JSX of the platform
HTML literals, the JSX of the platformHTML literals, the JSX of the platform
HTML literals, the JSX of the platform
 
Salesforce Auckland Developer Meetup - May 2018 - Lightning Web Components
Salesforce Auckland Developer Meetup - May 2018 - Lightning Web Components Salesforce Auckland Developer Meetup - May 2018 - Lightning Web Components
Salesforce Auckland Developer Meetup - May 2018 - Lightning Web Components
 
Sitepoint.com a basic-html5_template
Sitepoint.com a basic-html5_templateSitepoint.com a basic-html5_template
Sitepoint.com a basic-html5_template
 
CAP 756 UNIT 1.pptx
CAP 756 UNIT 1.pptxCAP 756 UNIT 1.pptx
CAP 756 UNIT 1.pptx
 
Introduction to Sightly and Sling Models
Introduction to Sightly and Sling ModelsIntroduction to Sightly and Sling Models
Introduction to Sightly and Sling Models
 
What is html xml and xhtml
What is html xml and xhtmlWhat is html xml and xhtml
What is html xml and xhtml
 
Dsc Charusat Learning React Part 1
Dsc Charusat Learning React Part 1 Dsc Charusat Learning React Part 1
Dsc Charusat Learning React Part 1
 

More from Ankit Gubrani

Sling pipes
Sling pipesSling pipes
Sling pipes
Ankit Gubrani
 
Circuit breaker pattern
Circuit breaker patternCircuit breaker pattern
Circuit breaker pattern
Ankit Gubrani
 
Sling models
Sling modelsSling models
Sling models
Ankit Gubrani
 
AEM integration with Apache Mahout
AEM integration with Apache MahoutAEM integration with Apache Mahout
AEM integration with Apache Mahout
Ankit Gubrani
 
Content personalization in AEM
Content personalization in AEMContent personalization in AEM
Content personalization in AEM
Ankit Gubrani
 
Integrating Apache Wookie with AEM || AEM-Wookie Connector Tool
Integrating Apache Wookie with AEM || AEM-Wookie Connector ToolIntegrating Apache Wookie with AEM || AEM-Wookie Connector Tool
Integrating Apache Wookie with AEM || AEM-Wookie Connector Tool
Ankit Gubrani
 
Build Automation using Maven
Build Automation using Maven Build Automation using Maven
Build Automation using Maven
Ankit Gubrani
 
AEM Client Context Customisation
AEM Client Context CustomisationAEM Client Context Customisation
AEM Client Context Customisation
Ankit Gubrani
 

More from Ankit Gubrani (8)

Sling pipes
Sling pipesSling pipes
Sling pipes
 
Circuit breaker pattern
Circuit breaker patternCircuit breaker pattern
Circuit breaker pattern
 
Sling models
Sling modelsSling models
Sling models
 
AEM integration with Apache Mahout
AEM integration with Apache MahoutAEM integration with Apache Mahout
AEM integration with Apache Mahout
 
Content personalization in AEM
Content personalization in AEMContent personalization in AEM
Content personalization in AEM
 
Integrating Apache Wookie with AEM || AEM-Wookie Connector Tool
Integrating Apache Wookie with AEM || AEM-Wookie Connector ToolIntegrating Apache Wookie with AEM || AEM-Wookie Connector Tool
Integrating Apache Wookie with AEM || AEM-Wookie Connector Tool
 
Build Automation using Maven
Build Automation using Maven Build Automation using Maven
Build Automation using Maven
 
AEM Client Context Customisation
AEM Client Context CustomisationAEM Client Context Customisation
AEM Client Context Customisation
 

Recently uploaded

Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
abdulrafaychaudhry
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ortus Solutions, Corp
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptxText-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
ShamsuddeenMuhammadA
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
Globus
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
timtebeek1
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
Shane Coughlan
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
Globus
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
Globus
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 

Recently uploaded (20)

Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptxText-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 

Introduction to Sightly

  • 2.
  • 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
  • 23.
  • 24. 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; }
  • 25. Thank You Please contact me at : ankit.gubrani@codebrains.co.in