The document provides information about HTML Template Language (HTL) in AEM, including what HTL is, why it was introduced, its main features and syntax. HTL is the preferred templating language for AEM that enforces separation of concerns between presentation and business logic. It uses HTML5 syntax along with additional data attributes and expressions to add dynamic functionality.
This document discusses client-side libraries in AEM and best practices for their use. It explains that clientlibs allow logical organization of JavaScript and CSS files and avoid duplicate includes. Key points covered include using cq:ClientLibraryFolders to define libraries, including them via cq:includeClientLib, dependencies vs embedding, debugging tools, themes, and minification. Best practices include placing component code in clientlibs, embedding to reduce requests, requesting from /etc, defining dependencies, and minification on publish.
Sling Models Using Sightly and JSP by Deepak Khetawat
This document discusses using Sling Models with Sightly and JSP templates in AEM. It provides an overview of Sling Models, including their purpose, design goals, and key annotations. It also describes the standard injectors available in Sling Models and how to create custom injectors. The document outlines how to add Sling Model dependencies and use Sling Models within JSP and Sightly templates, including code examples. It concludes with a demonstration of Sling Models in action and information for appendix materials and questions.
AEM (CQ) Dispatcher Security and CDN+Browser Caching
This presentation cover Adobe AEM Dispatcher security and CDN and browser caching.
This presentation is the second part of a webinar on AEM Dispatcher:
http://dev.day.com/content/ddc/en/gems/dispatcher-caching---new-features-and-optimizations.html
Visit url above to view the whole presentation. Domique Pfister the primary engineer developing AEM Dispatcher covers the first part on new features.
RichText Editor (RTE) is an integral component of AEM and it provides AEM authors a WYSIWYG text-editing experience on the web pages. RTE offers diverse configurations to developers.
This presentation provides an in-depth understanding of this component and shows various concepts, use-cases, modes, configurations, best practices, limitations and troubleshooting that surround it.
E-Seminar recording published here -
https://helpx.adobe.com/experience-manager/kt/eseminars/gems/AEM-Rich-Text-Editor-RTE-Deep-Dive1.html
This document discusses integration patterns in Adobe Experience Manager (AEM), including using Sling Models for dependency injection and accessing resources from different locations through a single ResourceResolver. It provides examples of integrating with backend APIs, databases, file systems and forms using techniques like ResourceProviders, Sling Filters and custom SlingServlets. It also covers accessing files from bundles and the filesystem using BundleResourceProvider and FsResourceProvider respectively.
OSGI is a Java framework that implements a dynamic component model. It allows modular Java applications to be built from separate bundles that can be loaded, started, stopped and updated independently. Key aspects include:
- Bundles are JAR files with additional configuration that can be loaded and stopped independently without affecting other bundles.
- Services allow bundles to publish and discover capabilities via a registry. Dependencies between bundles are resolved dynamically.
- The OSGi framework provides a lifecycle to manage the loading, starting and stopping of bundles.
- Annotations like @Component, @Service and @Reference allow defining OSGi components and services using declarative services.
- The OSGi specification is implemented by frameworks like
The document provides tips and best practices for configuring multiple farms in AEM Dispatcher. Key points include:
- Splitting the Dispatcher configuration into multiple farms based on different caching needs, such as separate farms for DAM assets and pages.
- Configuring different caching parameters and cache folders for each farm to optimize caching behavior.
- Handling cache invalidation requests and vanity URLs across multiple farms.
- Different approaches for flushing caches from Author and multiple Publishers to Dispatchers, and avoiding race conditions.
- Bypassing the Dispatcher cache for select clients by rewriting URLs to include parameters checked by the Dispatcher configuration.
This presentation describes how to easily get started with an efficient development workflow with Adobe Experience Manager 6.1.
The tools and technologies presented are:
* Project Archetype – https://github.com/Adobe-Marketing-Cloud/aem-project-archetype
* AEM Eclipse Extension – https://docs.adobe.com/docs/en/dev-tools/aem-eclipse.html
* AEM Brackets Extension – https://docs.adobe.com/docs/en/dev-tools/aem-brackets.html
* Sightly Template Language – http://www.slideshare.net/GabrielWalt/component-development
* Sightly REPL Tool – https://github.com/Adobe-Marketing-Cloud/aem-sightly-repl
* Sightly TodoMVC Example – https://github.com/Adobe-Marketing-Cloud/aem-sightly-sample-todomvc
This document provides an introduction to JavaScript, covering basic concepts like data types, variables, operators, conditionals, loops, functions, arrays, and objects. It explains that JavaScript is an interpreted language that allows dynamic and interactive functionality on websites. Key points are demonstrated through examples, like using alert to output "Hello World" and basic math operations with variables.
Chetan Mehrotra, Senior Computer Scientist, and Alex Parvulescu, Senior Developer, Adobe presented on Jan 20, 2016. They describe the features of Oak Lucene indexes and how they can be used to get your queries perform better. In the second part we will talk about how asynchronous indexing works in general and how it can be monitored.To view the on-demand session go to: http://bit.ly/AEMGems1202016 or for the MP4 version http://bit.ly/AEMGemsMP41202016
Rasheed Amir presents on Spring Boot. He discusses how Spring Boot aims to help developers build production-grade Spring applications quickly with minimal configuration. It provides default functionality for tasks like embedding servers and externalizing configuration. Spring Boot favors convention over configuration and aims to get developers started quickly with a single focus. It also exposes auto-configuration for common Spring and related technologies so that applications can take advantage of them without needing to explicitly configure them.
This document provides an introduction to JavaScript and its uses for web programming. It explains that JavaScript is a client-side scripting language that allows web pages to become interactive. Some key points covered include:
- JavaScript can change HTML content, styles, validate data, and make calculations.
- Functions are blocks of code that perform tasks when invoked by events or called in code.
- Events like clicks or keyboard presses trigger JavaScript code.
- The DOM (Document Object Model) represents an HTML document that JavaScript can access and modify.
- Forms and user input can be accessed and processed using the DOM.
- Programming flow can be controlled with conditional and loop statements.
-
The document discusses various methods for sharing data between Angular components, including:
1) Parent to child components using @Input to pass data via templates.
2) Child to parent using @ViewChild and AfterViewInit lifecycle hook to access child component properties.
3) Child to parent using @Output and event emitters to emit data on user events like button clicks.
4) Between unrelated components using a shared service with RxJs Subjects to share stream of data between all components accessing the service.
# By Frans Rosén
Adobe Experience Manager is an enterprise CMS with a troubled history. It was created with the angle of high customization factor, enabling consulting firms to deploy it all over the world for huge customers.
Then came security.
Frans will go through some terrible default configuration mistakes, Adobe’s love for bad Flash and how a sysadmin accidentialy exposed an international multi billion dollar company using only sad thoughts.
# About speaker
Frans Rosén is a tech entrepreneur, bug bounty hunter and a Security Advisor at Detectify, a security service for developers. He’s a frequent blogger at Detectify Labs and a top ranked participant of bug bounty programs, receiving some of the highest bounty payouts ever on HackerOne.
Frans was recently featured as #2 on Hackread’s list of 10 Famous Bug Bounty Hunters of All Time and the results of his security research has been covered in numerous international publications such as Observer, BBC, Ars Technica, Wired and Mashable.
This document discusses data binding in AngularJS. It explains what data binding is, the difference between one-time and two-way binding, and how data binding works through dirty checking. Data binding connects the UI and business logic by allowing changes in the model to be reflected in the view and vice versa. One-time binding only updates the view once from the controller value, reducing the number of watchers and improving performance compared to two-way binding. The document also provides examples of data binding and takes questions.
Andreea Corbeanu & Christian Meyer - Adobe
How to extend a dialog by purely providing the missing pieces via the Sling Resource Merger
* Customizable search facets
How to create custom search facets
* Custom page properties bulk editing
How to add a custom field to the bulk editing
This audit of a law firm's website www.awf.ae identifies several issues that need to be addressed to improve usability and marketing. It is unclear what services the site offers or how visitors' problems could be resolved. The navigation is unclear and there is too much unreadable text. Key recommendations include simplifying content, adding things like phone numbers and opening hours, improving speed and the mobile version, restructuring articles to drive sales, and analyzing SEO and traffic sources to improve marketing. Addressing these issues would help visitors understand what the site offers and how it can help solve their legal issues.
The document outlines steps to improve a sales process, including defining strengths and weaknesses, breaking improvements into chunks, coaching for better performance, focusing on outcomes, building credibility and rapport with customers, listening to understand their needs, gaining permission to provide solutions, offering experiences over words, role playing deals to practice asking for outcomes, removing emotions when handling objections, planning next steps before meetings, and developing lists to support the process. Implementing a defined sales process will enable salespeople to improve performance.
SEO - Estrategias de Posicionamiento en Buscadores
Este documento describe las técnicas de SEO (Search Engine Optimization) o posicionamiento en buscadores. Explica el análisis de palabras clave, incluyendo la definición, estudio de la competencia y selección de palabras clave. También cubre las técnicas SEO "on-page", como elementos como el título, la descripción y los enlaces internos. Por último, resume las técnicas SEO "off-page" como el link building y la creación de enlaces externos desde otras páginas para mejorar la visibilidad de un sit
WSC is a small IT company in Estonia and Latvia that provides web development solutions. It has three directors leading employees across marketing, technical, and other areas. WSC aims to deliver high-tech solutions quickly using its ABC methodology. It plans to move from services to products by completing its MCCNSE project and targeting the Baltic market. WSC believes in innovation and its upcoming MCCNSE product could succeed in the market.
Backup? Who cares! Now and Then? We store our data in the cloud. Somewhere in the Cloud. Which Cloud? Who cares! But we are still SQL Server Professionals, so… are we need backup? Should we use newest opportunities or old methods? Are we going a step further or step back? On my session, I will try to find answers for all of those (and more) questions. Demos, cases, and examples from the world of backup. And of course worst practices.
HTML is a markup language used to define the structure and layout of web pages. CSS is used to style and lay out HTML elements, and JavaScript can be used to program behaviors and interactions in web pages. jQuery is a JavaScript library that simplifies HTML document traversal and manipulation, as well as event handling, animations, and Ajax interactions for rapid web development.
about this presentation:
1) this presentation was a quickie for non-tech employees, who wanted a basic understanding of html/css, as it related to a white-label SAAS product;
2) the back-end/front-end definitions relate to the specific application (it's inaccurate if node.js is in the picture)
HTML is a markup language used to define the structure and layout of web pages. HTML uses tags to mark elements like headings, paragraphs, links, images, and tables. Some key tags include:
<h1> for main headings, <p> for paragraphs, <a> for links, <img> for images, and <table> for tables. Elements are everything between a starting and ending tag. HTML documents contain tags and plain text and are displayed in web browsers.
The document provides an overview of HTML5, describing it as the latest and most enhanced version of HTML. It outlines several new features of HTML5, including new semantic elements, forms improvements, local storage, web sockets, canvas, audio/video embedding, geolocation, and drag and drop. It also covers HTML5 syntax rules and compatibility with older browsers. The document is intended to provide information on HTML5's easy learning and use for rapid web development.
This document provides an introduction to HTML, CSS, and WordPress. It covers the basics of HTML including common tags for formatting text, images, and links. It then discusses using CSS to style HTML elements using classes, IDs, and other selectors. Finally, it gives an overview of how HTML and CSS are used together in WordPress templates and themes.
This document discusses Sling Models, which provide a simplified way to adapt Sling resources into domain objects in AEM. Some key points:
- Sling Models allow resources to be adapted to POJOs with minimal code using annotations like @Model and @Inject. This is cleaner than previous "adapter factory" approaches.
- Common use cases like injecting resource properties, child resources, services and more are supported out of the box via standard injectors.
- Sling Models are pluggable, so custom injectors can be added to inject non-standard dependencies.
- They allow resources and requests to be adapted to either classes or interfaces, keeping domain objects simple POJOs.
This document discusses Sling Models in AEM, including what they are, why they are useful, how to use them, and examples of Sling Model annotations. Sling Models allow mapping of Sling objects like resources and requests to plain Java objects using annotations. They reduce coding efforts and make code more maintainable by avoiding redundant code. The document covers the necessary dependencies, common annotations like @Model, @Inject, @Optional, and examples of injecting resources, child resources, and retrieving values from the request.
This document discusses client-side libraries in AEM and best practices for their use. It explains that clientlibs allow logical organization of JavaScript and CSS files and avoid duplicate includes. Key points covered include using cq:ClientLibraryFolders to define libraries, including them via cq:includeClientLib, dependencies vs embedding, debugging tools, themes, and minification. Best practices include placing component code in clientlibs, embedding to reduce requests, requesting from /etc, defining dependencies, and minification on publish.
Sling Models Using Sightly and JSP by Deepak KhetawatAEM HUB
This document discusses using Sling Models with Sightly and JSP templates in AEM. It provides an overview of Sling Models, including their purpose, design goals, and key annotations. It also describes the standard injectors available in Sling Models and how to create custom injectors. The document outlines how to add Sling Model dependencies and use Sling Models within JSP and Sightly templates, including code examples. It concludes with a demonstration of Sling Models in action and information for appendix materials and questions.
AEM (CQ) Dispatcher Security and CDN+Browser CachingAndrew Khoury
This presentation cover Adobe AEM Dispatcher security and CDN and browser caching.
This presentation is the second part of a webinar on AEM Dispatcher:
http://dev.day.com/content/ddc/en/gems/dispatcher-caching---new-features-and-optimizations.html
Visit url above to view the whole presentation. Domique Pfister the primary engineer developing AEM Dispatcher covers the first part on new features.
RichText Editor (RTE) is an integral component of AEM and it provides AEM authors a WYSIWYG text-editing experience on the web pages. RTE offers diverse configurations to developers.
This presentation provides an in-depth understanding of this component and shows various concepts, use-cases, modes, configurations, best practices, limitations and troubleshooting that surround it.
E-Seminar recording published here -
https://helpx.adobe.com/experience-manager/kt/eseminars/gems/AEM-Rich-Text-Editor-RTE-Deep-Dive1.html
This document discusses integration patterns in Adobe Experience Manager (AEM), including using Sling Models for dependency injection and accessing resources from different locations through a single ResourceResolver. It provides examples of integrating with backend APIs, databases, file systems and forms using techniques like ResourceProviders, Sling Filters and custom SlingServlets. It also covers accessing files from bundles and the filesystem using BundleResourceProvider and FsResourceProvider respectively.
OSGI is a Java framework that implements a dynamic component model. It allows modular Java applications to be built from separate bundles that can be loaded, started, stopped and updated independently. Key aspects include:
- Bundles are JAR files with additional configuration that can be loaded and stopped independently without affecting other bundles.
- Services allow bundles to publish and discover capabilities via a registry. Dependencies between bundles are resolved dynamically.
- The OSGi framework provides a lifecycle to manage the loading, starting and stopping of bundles.
- Annotations like @Component, @Service and @Reference allow defining OSGi components and services using declarative services.
- The OSGi specification is implemented by frameworks like
The document provides tips and best practices for configuring multiple farms in AEM Dispatcher. Key points include:
- Splitting the Dispatcher configuration into multiple farms based on different caching needs, such as separate farms for DAM assets and pages.
- Configuring different caching parameters and cache folders for each farm to optimize caching behavior.
- Handling cache invalidation requests and vanity URLs across multiple farms.
- Different approaches for flushing caches from Author and multiple Publishers to Dispatchers, and avoiding race conditions.
- Bypassing the Dispatcher cache for select clients by rewriting URLs to include parameters checked by the Dispatcher configuration.
AEM Best Practices for Component DevelopmentGabriel Walt
This presentation describes how to easily get started with an efficient development workflow with Adobe Experience Manager 6.1.
The tools and technologies presented are:
* Project Archetype – https://github.com/Adobe-Marketing-Cloud/aem-project-archetype
* AEM Eclipse Extension – https://docs.adobe.com/docs/en/dev-tools/aem-eclipse.html
* AEM Brackets Extension – https://docs.adobe.com/docs/en/dev-tools/aem-brackets.html
* Sightly Template Language – http://www.slideshare.net/GabrielWalt/component-development
* Sightly REPL Tool – https://github.com/Adobe-Marketing-Cloud/aem-sightly-repl
* Sightly TodoMVC Example – https://github.com/Adobe-Marketing-Cloud/aem-sightly-sample-todomvc
This document provides an introduction to JavaScript, covering basic concepts like data types, variables, operators, conditionals, loops, functions, arrays, and objects. It explains that JavaScript is an interpreted language that allows dynamic and interactive functionality on websites. Key points are demonstrated through examples, like using alert to output "Hello World" and basic math operations with variables.
Chetan Mehrotra, Senior Computer Scientist, and Alex Parvulescu, Senior Developer, Adobe presented on Jan 20, 2016. They describe the features of Oak Lucene indexes and how they can be used to get your queries perform better. In the second part we will talk about how asynchronous indexing works in general and how it can be monitored.To view the on-demand session go to: http://bit.ly/AEMGems1202016 or for the MP4 version http://bit.ly/AEMGemsMP41202016
Rasheed Amir presents on Spring Boot. He discusses how Spring Boot aims to help developers build production-grade Spring applications quickly with minimal configuration. It provides default functionality for tasks like embedding servers and externalizing configuration. Spring Boot favors convention over configuration and aims to get developers started quickly with a single focus. It also exposes auto-configuration for common Spring and related technologies so that applications can take advantage of them without needing to explicitly configure them.
This document provides an introduction to JavaScript and its uses for web programming. It explains that JavaScript is a client-side scripting language that allows web pages to become interactive. Some key points covered include:
- JavaScript can change HTML content, styles, validate data, and make calculations.
- Functions are blocks of code that perform tasks when invoked by events or called in code.
- Events like clicks or keyboard presses trigger JavaScript code.
- The DOM (Document Object Model) represents an HTML document that JavaScript can access and modify.
- Forms and user input can be accessed and processed using the DOM.
- Programming flow can be controlled with conditional and loop statements.
-
The document discusses various methods for sharing data between Angular components, including:
1) Parent to child components using @Input to pass data via templates.
2) Child to parent using @ViewChild and AfterViewInit lifecycle hook to access child component properties.
3) Child to parent using @Output and event emitters to emit data on user events like button clicks.
4) Between unrelated components using a shared service with RxJs Subjects to share stream of data between all components accessing the service.
A story of the passive aggressive sysadmin of AEMFrans Rosén
# By Frans Rosén
Adobe Experience Manager is an enterprise CMS with a troubled history. It was created with the angle of high customization factor, enabling consulting firms to deploy it all over the world for huge customers.
Then came security.
Frans will go through some terrible default configuration mistakes, Adobe’s love for bad Flash and how a sysadmin accidentialy exposed an international multi billion dollar company using only sad thoughts.
# About speaker
Frans Rosén is a tech entrepreneur, bug bounty hunter and a Security Advisor at Detectify, a security service for developers. He’s a frequent blogger at Detectify Labs and a top ranked participant of bug bounty programs, receiving some of the highest bounty payouts ever on HackerOne.
Frans was recently featured as #2 on Hackread’s list of 10 Famous Bug Bounty Hunters of All Time and the results of his security research has been covered in numerous international publications such as Observer, BBC, Ars Technica, Wired and Mashable.
This document discusses data binding in AngularJS. It explains what data binding is, the difference between one-time and two-way binding, and how data binding works through dirty checking. Data binding connects the UI and business logic by allowing changes in the model to be reflected in the view and vice versa. One-time binding only updates the view once from the controller value, reducing the number of watchers and improving performance compared to two-way binding. The document also provides examples of data binding and takes questions.
CIRCUIT 2015 - UI Customization in AEM 6.1ICF CIRCUIT
Andreea Corbeanu & Christian Meyer - Adobe
How to extend a dialog by purely providing the missing pieces via the Sling Resource Merger
* Customizable search facets
How to create custom search facets
* Custom page properties bulk editing
How to add a custom field to the bulk editing
This audit of a law firm's website www.awf.ae identifies several issues that need to be addressed to improve usability and marketing. It is unclear what services the site offers or how visitors' problems could be resolved. The navigation is unclear and there is too much unreadable text. Key recommendations include simplifying content, adding things like phone numbers and opening hours, improving speed and the mobile version, restructuring articles to drive sales, and analyzing SEO and traffic sources to improve marketing. Addressing these issues would help visitors understand what the site offers and how it can help solve their legal issues.
The document outlines steps to improve a sales process, including defining strengths and weaknesses, breaking improvements into chunks, coaching for better performance, focusing on outcomes, building credibility and rapport with customers, listening to understand their needs, gaining permission to provide solutions, offering experiences over words, role playing deals to practice asking for outcomes, removing emotions when handling objections, planning next steps before meetings, and developing lists to support the process. Implementing a defined sales process will enable salespeople to improve performance.
Este documento describe las técnicas de SEO (Search Engine Optimization) o posicionamiento en buscadores. Explica el análisis de palabras clave, incluyendo la definición, estudio de la competencia y selección de palabras clave. También cubre las técnicas SEO "on-page", como elementos como el título, la descripción y los enlaces internos. Por último, resume las técnicas SEO "off-page" como el link building y la creación de enlaces externos desde otras páginas para mejorar la visibilidad de un sit
WSC is a small IT company in Estonia and Latvia that provides web development solutions. It has three directors leading employees across marketing, technical, and other areas. WSC aims to deliver high-tech solutions quickly using its ABC methodology. It plans to move from services to products by completing its MCCNSE project and targeting the Baltic market. WSC believes in innovation and its upcoming MCCNSE product could succeed in the market.
Backup? Who cares! Now and Then? We store our data in the cloud. Somewhere in the Cloud. Which Cloud? Who cares! But we are still SQL Server Professionals, so… are we need backup? Should we use newest opportunities or old methods? Are we going a step further or step back? On my session, I will try to find answers for all of those (and more) questions. Demos, cases, and examples from the world of backup. And of course worst practices.
HTML is a markup language used to define the structure and layout of web pages. CSS is used to style and lay out HTML elements, and JavaScript can be used to program behaviors and interactions in web pages. jQuery is a JavaScript library that simplifies HTML document traversal and manipulation, as well as event handling, animations, and Ajax interactions for rapid web development.
about this presentation:
1) this presentation was a quickie for non-tech employees, who wanted a basic understanding of html/css, as it related to a white-label SAAS product;
2) the back-end/front-end definitions relate to the specific application (it's inaccurate if node.js is in the picture)
HTML is a markup language used to define the structure and layout of web pages. HTML uses tags to mark elements like headings, paragraphs, links, images, and tables. Some key tags include:
<h1> for main headings, <p> for paragraphs, <a> for links, <img> for images, and <table> for tables. Elements are everything between a starting and ending tag. HTML documents contain tags and plain text and are displayed in web browsers.
The document provides an overview of HTML5, describing it as the latest and most enhanced version of HTML. It outlines several new features of HTML5, including new semantic elements, forms improvements, local storage, web sockets, canvas, audio/video embedding, geolocation, and drag and drop. It also covers HTML5 syntax rules and compatibility with older browsers. The document is intended to provide information on HTML5's easy learning and use for rapid web development.
This document provides an introduction to HTML, CSS, and WordPress. It covers the basics of HTML including common tags for formatting text, images, and links. It then discusses using CSS to style HTML elements using classes, IDs, and other selectors. Finally, it gives an overview of how HTML and CSS are used together in WordPress templates and themes.
The document provides an overview of HTML5 and how to build web applications with it. Some key points covered include:
- HTML5 is the latest version of HTML and supports new elements, tags, and attributes
- HTML5 pages can be built by writing code between angle brackets and saving it as a file with an .html extension
- CSS can be used to style HTML5 pages through selectors, properties, and linking external style sheets
- JavaScript adds interactivity by manipulating the DOM and creating dynamic content
- Features like forms, multimedia, and drag-and-drop are improved in HTML5 for building robust web applications
The document provides an overview of HTML elements and tags for basic webpage structure and formatting. It discusses the <html>, <head>, <body> tags and their uses. It also covers common text formatting tags (<p>, <h1>-<h6>), lists (<ul>, <ol>, <li>), links (<a>), images (<img>), and the differences between relative and absolute links. The document is intended as an introduction to basic HTML tags and elements for building webpage structure.
The document provides a cheat sheet for HTML and HTML5 tags, including:
1. An overview of common tags for document structure like <html>, <head>, <body>, and headings; formatting tags like <p>, <strong>, and <em>; and links and images with <a> and <img>.
2. Descriptions of lists (<ul>, <ol>, <li>), forms, tables, and multimedia with tags like <map>, <area>, <video>, and <audio>.
3. A list of new HTML5 tags and character entities at the end. The cheat sheet covers the essential tags for text, structure, links, images, and lists to provide a high-
HTML from A to Z
HTML Basics : Basics-Semantic Elements-Attributes-Block and Inline Elements-Forms-Responsive Web Design-XHTML…..
HTML for Text Formatting : Text formatting-Links-Tables-Lists-Symbols-Space…
HTML Visuals and Media : Layout-Classes-Colors-Images-Multimedia…
Lecture 2 HTML part 1.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvZahouAmel1
Lecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 10 CSS part 2.pptxvvvvvvvvvvvvvv
The document provides an overview of HTML (Hypertext Markup Language) including:
1) HTML is a markup language used to describe web pages using tags to structure content like headings, paragraphs, lists, links, images and tables.
2) Various HTML tags are described like <h1>-<h6> for headings, <p> for paragraphs, <b> for bold, <i> for italic, and <a> for links.
3) Additional HTML concepts covered include internal and external CSS, meta tags, images, tables, frames, iframes and cascading style sheets (CSS) for styling content.
The document discusses the basics of HTML including:
- Common tags such as <p>, <h1>-<h6>, <ul>, <ol>, <li>, and <a> for formatting text and creating lists and links.
- The <head> and <body> sections and required <title> and <meta> tags.
- Additional tags for images (<img>), headings (<hr>), quotes (<blockquote>, <q>), and preformatted text (<pre>).
- Using the <style> element or style attribute to control formatting.
The document provides an introduction to Django, including how to install it, set up a project and app, work with models and migrations, write views and templates, and use the admin interface. Key aspects covered include Django being a Python-based web framework using the MTV design pattern, installing Django in a virtual environment, creating models to represent database tables and relationships, and rendering data to templates from views.
Introduction to Html5, css, Javascript and Jqueryvaluebound
To customize the look and feel of a web page, it is absolutely necessary to understand what is HTML, why CSS, and what are Javascript and Jquery. Javascript and Jquery help in interactive frontend development.
The document discusses DHTML and its components. DHTML uses HTML to create page elements, CSS for formatting and styling, and JavaScript for dynamic interactivity. It allows animation, pop-ups, dragging/dropping elements, and incorporating external data. The document then provides information on each technology: HTML uses tags to structure pages, CSS controls presentation with style sheets, and JavaScript adds interactive behaviors and controls HTML and CSS properties. Examples are given to demonstrate each technology and how they work together in DHTML.
The document discusses the Django web application framework. It provides an overview of Django, describing its MVT architecture with Models for the data structure, Views for controlling what users see, and Templates for how users see it. It also covers Django's modules for forms, administration interface, caching, and more. An example project is described to illustrate starting a project, adding an app with a model, and exploring the admin interface.
The document discusses the Django web application framework. It provides an overview of Django, describing its MVT architecture with Models for the data structure, Views for controlling what users see, and Templates for how users see it. It also covers Django's modules for forms, administration interface, caching, and more. An example project is described to illustrate starting a project, adding an app with a model, and exploring the admin interface.
This document provides an introduction to HTML tags. It discusses the <!DOCTYPE> declaration that must be the first line of code, and covers the HTML, <head>, <title>, <meta>, <style> and <script> tags that can go within the <head> section. It also covers presentational tags like <b> and <i>, semantic tags like <h1-h6> headers, and <meta> tags for SEO purposes like keywords and descriptions. The document provides examples of different doctype declarations for HTML 4.01 strict and transitional versions.
Similar to HTL(Sightly) - All you need to know (20)
An MVP (Minimum Viable Product) mobile application is a streamlined version of a mobile app that includes only the core features necessary to address the primary needs of its users. The purpose of an MVP is to validate the app concept with minimal resources, gather user feedback, and identify any areas for improvement before investing in a full-scale development. This approach allows businesses to quickly launch their app, test its market viability, and make data-driven decisions for future enhancements, ensuring a higher likelihood of success and user satisfaction.
React Native vs Flutter - SSTech SystemSSTech System
Your project needs and long-term objectives will ultimately choose which of React Native and Flutter to use. For applications using JavaScript and current web technologies in particular, React Native is a mature and trustworthy choice. For projects that value performance and customizability across many platforms, Flutter, on the other hand, provides outstanding performance and a unified UI development experience.
Seamless PostgreSQL to Snowflake Data Transfer in 8 Simple StepsEstuary Flow
Unlock the full potential of your data by effortlessly migrating from PostgreSQL to Snowflake, the leading cloud data warehouse. This comprehensive guide presents an easy-to-follow 8-step process using Estuary Flow, an open-source data operations platform designed to simplify data pipelines.
Discover how to seamlessly transfer your PostgreSQL data to Snowflake, leveraging Estuary Flow's intuitive interface and powerful real-time replication capabilities. Harness the power of both platforms to create a robust data ecosystem that drives business intelligence, analytics, and data-driven decision-making.
Key Takeaways:
1. Effortless Migration: Learn how to migrate your PostgreSQL data to Snowflake in 8 simple steps, even with limited technical expertise.
2. Real-Time Insights: Achieve near-instantaneous data syncing for up-to-the-minute analytics and reporting.
3. Cost-Effective Solution: Lower your total cost of ownership (TCO) with Estuary Flow's efficient and scalable architecture.
4. Seamless Integration: Combine the strengths of PostgreSQL's transactional power with Snowflake's cloud-native scalability and data warehousing features.
Don't miss out on this opportunity to unlock the full potential of your data. Read & Download this comprehensive guide now and embark on a seamless data journey from PostgreSQL to Snowflake with Estuary Flow!
Try it Free: https://dashboard.estuary.dev/register
What is OCR Technology and How to Extract Text from Any Image for FreeTwisterTools
Discover the fascinating world of Optical Character Recognition (OCR) technology with our comprehensive presentation. Learn how OCR converts various types of documents, such as scanned paper documents, PDFs, or images captured by a digital camera, into editable and searchable data. Dive into the history, modern applications, and future trends of OCR technology. Get step-by-step instructions on how to extract text from any image online for free using a simple tool, along with best practices for OCR image preparation. Ideal for professionals, students, and tech enthusiasts looking to harness the power of OCR.
introduction of Ansys software and basic and advance knowledge of modelling s...sachin chaurasia
Ansys Mechanical enables you to solve complex structural engineering problems and make better, faster design decisions. With the finite element analysis (FEA) solvers available in the suite, you can customize and automate solutions for your structural mechanics problems and parameterize them to analyze multiple design scenarios. Ansys Mechanical is a dynamic tool that has a complete range of analysis tools.
React and Next.js are complementary tools in web development. React, a JavaScript library, specializes in building user interfaces with its component-based architecture and efficient state management. Next.js extends React by providing server-side rendering, routing, and other utilities, making it ideal for building SEO-friendly, high-performance web applications.
Lots of bloggers are using Google AdSense now. It’s getting really popular. With AdSense, bloggers can make money by showing ads on their websites. Read this important article written by the experienced designers of the best website designing company in Delhi –
A captivating AI chatbot PowerPoint presentation is made with a striking backdrop in order to attract a wider audience. Select this template featuring several AI chatbot visuals to boost audience engagement and spontaneity. With the aid of this multi-colored template, you may make a compelling presentation and get extra bonuses. To easily elucidate your ideas, choose a typeface with vibrant colors. You can include your data regarding utilizing the chatbot methodology to the remaining half of the template.
A Comparative Analysis of Functional and Non-Functional Testing.pdfkalichargn70th171
A robust software testing strategy encompassing functional and non-functional testing is fundamental for development teams. These twin pillars are essential for ensuring the success of your applications. But why are they so critical?
Functional testing rigorously examines the application's processes against predefined requirements, ensuring they align seamlessly. Conversely, non-functional testing evaluates performance and reliability under load, enhancing the end-user experience.
Sami provided a beginner-friendly introduction to Amazon Web Services (AWS), covering essential terms, products, and services for cloud deployment. Participants explored AWS' latest Gen AI offerings, making it accessible for those starting their cloud journey or integrating AI into coding practices.
IN Dubai [WHATSAPP:Only (+971588192166**)] Abortion Pills For Sale In Dubai** UAE** Mifepristone and Misoprostol Tablets Available In Dubai** UAE
CONTACT DR. SINDY Whatsapp +971588192166* We Have Abortion Pills / Cytotec Tablets /Mifegest Kit Available in Dubai** Sharjah** Abudhabi** Ajman** Alain** Fujairah** Ras Al Khaimah** Umm Al Quwain** UAE** Buy cytotec in Dubai +971588192166* '''Abortion Pills near me DUBAI | ABU DHABI|UAE. Price of Misoprostol** Cytotec” +971588192166* ' Dr.SINDY ''BUY ABORTION PILLS MIFEGEST KIT** MISOPROSTOL** CYTOTEC PILLS IN DUBAI** ABU DHABI**UAE'' Contact me now via What's App… abortion pills in dubai Mtp-Kit Prices
abortion pills available in dubai/abortion pills for sale in dubai/abortion pills in uae/cytotec dubai/abortion pills in abu dhabi/abortion pills available in abu dhabi/abortion tablets in uae
… abortion Pills Cytotec also available Oman Qatar Doha Saudi Arabia Bahrain Above all** Cytotec Abortion Pills are Available In Dubai / UAE** you will be very happy to do abortion in Dubai we are providing cytotec 200mg abortion pills in Dubai** UAE. Medication abortion offers an alternative to Surgical Abortion for women in the early weeks of pregnancy. We only offer abortion pills from 1 week-6 Months. We then advise you to use surgery if it's beyond 6 months. Our Abu Dhabi** Ajman** Al Ain** Dubai** Fujairah** Ras Al Khaimah (RAK)** Sharjah** Umm Al Quwain (UAQ) United Arab Emirates Abortion Clinic provides the safest and most advanced techniques for providing non-surgical** medical and surgical abortion methods for early through late second trimester** including the Abortion By Pill Procedure (RU 486** Mifeprex** Mifepristone** early options French Abortion Pill)** Tamoxifen** Methotrexate and Cytotec (Misoprostol). The Abu Dhabi** United Arab Emirates Abortion Clinic performs Same Day Abortion Procedure using medications that are taken on the first day of the office visit and will cause the abortion to occur generally within 4 to 6 hours (as early as 30 minutes) for patients who are 3 to 12 weeks pregnant. When Mifepristone and Misoprostol are used** 50% of patients complete in 4 to 6 hours; 75% to 80% in 12 hours; and 90% in 24 hours. We use a regimen that allows for completion without the need for surgery 99% of the time. All advanced second trimester and late term pregnancies at our Tampa clinic (17 to 24 weeks or greater) can be completed within 24 hours or less 99% of the time without the need for surgery. The procedure is completed with minimal to no complications. Our Women's Health Center located in Abu Dhabi** United Arab Emirates** uses the latest medications for medical abortions (RU-486** Mifeprex** Mifegyne** Mifepristone** early options French abortion pill)** Methotrexate and Cytotec (Misoprostol). The safety standards of our Abu Dhabi** United Arab Emirates Abortion Doctors remain unparalleled. They consistently maintain the lowest complication rates throughout the nation. Our
Are you wondering how to migrate to the Cloud? At the ITB session, we addressed the challenge of managing multiple ColdFusion licenses and AWS EC2 instances. Discover how you can consolidate with just one EC2 instance capable of running over 50 apps using CommandBox ColdFusion. This solution supports both ColdFusion flavors and includes cb-websites, a GoLang binary for managing CommandBox websites.
Ansys Mechanical enables you to solve complex structural engineering problems and make better, faster design decisions. With the finite element analysis (FEA) solvers available in the suite, you can customize and automate solutions for your structural mechanics problems and parameterize them to analyze multiple design scenarios. Ansys Mechanical is a dynamic tool that has a complete range of analysis tools.
2. www.tothenew.com
Agenda
● What is HTL?
● Why HTL?
● Global Objects
● HTL Block Statements
● HTL Use-API
● HTL Expression Options
● Best Practises
3. www.tothenew.com
What is HTML Template Language (HTL)?
● Introduced with AEM 6.0
● Takes the place of JSP as the preferred server-side template system
for HTML
● Enforces separation of concerns between Presentation & Business
logic
● A HTL file contains HTML, some basic presentation logic and
variables to be evaluated at runtime
● Sightly was renamed to “HTML Template Language” from August
2016
4. www.tothenew.com
Why HTL?
● Simplified Development:
○ Purposely limited features: Easy to learn and enforces strict
separation of concerns between markup and logic.
○ HTL template is itself a valid HTML5 file: Doesn't break the validity of
the markup and keeps it readable
○ Allows HTML developers without Java knowledge and with little
product-specific knowledge to be able to edit HTL templates
○ Allows Java developers to focus on the back-end code without
worrying about HTML
After Sightly
5. www.tothenew.com
Why HTL?
● Increased Security:
○ HTL automatically filters and escapes all text being output to the
presentation layer to prevent cross-site-scripting(XSS) vulnerabilities.
○ Automatically applies the proper context-aware escaping to all
variables being output to the presentation layer
6. www.tothenew.com
AEM HTL Read–Eval–Print Loop
● To try out basic HTL, a live execution environment called the
Read Eval Print Loop can be used.
● Download Link & documentation:
https://github.com/Adobe-Marketing-Cloud/aem-htl-repl
● After package installation, go to /content/repl.html
?
7. www.tothenew.com
HTL Syntax
• Every HTL file is an HTML5 document or fragment, augmented with a
specific syntax that adds the dynamic functionality.
There are two different kind of Syntaxes:-
• HTL Block Statements:- To define structural block elements within HTL
file, HTL employs HTML5 data attributes. This allows to attach behavior
to existing HTML elements. Block statements can't be used inside html
comments, style n script elements. A block statement starts with data-
sly.
• HTL Expressions:- HTL expressions are delimited by characters ${ and }.
At runtime, these expressions are evaluated and their value is injected
into the outgoing HTML stream. Expressions can only be used in
attribute values, in element content, or in comments.
10. www.tothenew.com
Comments
HTL comments are HTML comments with additional syntax. They are
delimited like this:
<!--/* A HTL Comment */-->
However, the content of standard HTML comments, delimited like this:
<!-- An HTML Comment -->
will be passed through the HTL processor and expressions within the
comment will be evaluated.
12. www.tothenew.com
data-sly-test
• Conditionally removes the host element and it‘s content if an
expression evaluates to false.
• Values that can be converted to false are: undefined variables, null
values, the number zero, and empty strings.
• data-sly-test also supports the naming and reuse of tests.
Example
<div data-sly-test.author="${wcmmode.edit || wcmmode.design}">
Show this to the author
</div>
<div data-sly-test="${!author}">
Not in author mode anymore..
</div>
13. www.tothenew.com
• data-sly-include : Includes the output of a rendering script run with the current
context, passing back control to the current Sightly script.
<div data-sly-include="template.html"></div>
<div data-sly-include="template.jsp"></div>
• The element on which a data-sly-include has been set is ignored and not
displayed
data-sly-include
14. www.tothenew.com
data-sly-resource
• Includes a rendered resource from the same server, using an absolute or relative path.
Examples:
<div data-sly-resource="${ @path='par',
resourceType='foundation/components/parsys'}"/>
With an expression more options can be specified:
<section data-sly-resource="${'my/path' @ appendPath='appended/path'}"></section>
<section data-sly-resource="${'my/path' @ prependPath='prepended/path'}"></section>
Manipulating selectors:
<section data-sly-resource="${'my/path' @ selectors='selector1.selector2'}" />
<section data-sly-resource="${'my/path' @ addSelectors=['selector1', 'selector2']}" />
<section data-sly-resource="${'my/path' @removeSelectors=['selector1','selector2']}" />
By default, the AEM decoration tags are disabled, the decorationTagName option allows to
bring them back, and the cssClassName to add classes to that element.
<article data-sly-resource="${'path/to/resource' @ decorationTagName='span',
cssClassName='className'}"></article>
15. www.tothenew.com
data-sly-attribute
• Sets an attribute or a group of attributes on the current element :
<tag class="className" data-sly-attribute.class="${myVar}"></tag>
This overwrites the content of the class attribute
Assuming that foobar = {'id' : 'foo', 'class' : 'bar'} ,
<input data-sly-attribute="${foobar}" type="text"/>
outputs : <input id="foo" class="bar" type="text"/>
• Attributes are processed left-to-right :
<div class="bar1" data-sly-attribute.class="bar2" data-sly-
attribute="${foobar}"></div>
outputs: <div id="foo" class="bar"></div>
16. www.tothenew.com
• Changes the element, mostly useful for setting element tags like h1..h6, th, td,
ol, ul :
<div data-sly-element"${'h1'}">Sightly Element Example</div>
outputs: <h1>Sightly Element Example</h1>
For security reasons, data-sly-element accepts only the following element names:
a abbr address article aside b bdi bdo blockquote br caption cite code col colgroup
data dd del dfn div dl dt em figcaption figure footer h1 h2 h3 h4 h5 h6 header i ins
kbd li main mark nav ol p pre q rp rt ruby s samp section small span strong sub
sup table tbody td tfoot th thead time tr u var wbr
data-sly-text
• Replaces the content of its host element with the specified text.
<p data-sly-text="${properties.jcr:description}">Lorem ipsum</p>
data-sly-element
17. www.tothenew.com
data-sly-list
● Repeats the content of the host element for each property in the provided
object.
<ul data-sly-list="${currentPage.listChildren}">
<li> index: ${itemList.index}, value: ${item.title} </li>
</ul>
<ul data-sly-list.child="${myObj}">
<li> key: ${child}, value: ${myObj[child]} </li>
</ul>
● itemList holds the following properties:
index: zero-based counter (0..length-1).
count: one-based counter (1..length).
first: true if the current item is the first item.
middle: true if the current item is neither the first nor the last item.
last: true if the current item is the last item.
odd: true if index is odd.
even: true if index is even.
18. www.tothenew.com
● Template blocks can be used like function calls:
○ Parameters can be passed when calling templates.
○ They also allow recursion.
● Template Declaration :
<template data-sly-template.example="${@ class, text}">
<span class="${class}">${text}</span>
</template>
● Call Statement :
<div data-sly-call="${example @ class=‘css-class', text='Hi'}"></div>
● Output:
<div><span class="css-class">Hi</span></div>
Template & Call Statements
19. www.tothenew.com
• Initializes a helper object (defined in JavaScript or Java) and exposes it through a
variable:
JS: <div data-sly-use.page="customPage.js">${page.foo}</div>
Java: <div data-sly-use.nav="Navigation">${nav.foo}</div>
• Parameters can be passed to the Use-API by using expression options:
<div data-sly-use.nav="${'Navigation' @ depth=1,showVisible=!wcmmode.edit}">
${nav.foo}
</div>
• Also used to load data-sly-template markup snippets located in a different file :
data-sly-use
<!-- library.html -->
<template data-sly-template.foo="${@ text}">
<span
class="example">${text}</span>
</template>
<!-- template.html -->
<div data-sly-use.library="library.html"
data-sly-call="${library.foo @
text='Hi'}"> </div>
Output:
<div><span class="example">Hi</span></div>
20. www.tothenew.com
HTL Use-API
Java Use-API JavaScript Use-API
Pros ● faster
● can be inspected with a
debugger
● easy to unit-test
● can be modified by front-end
developers
● is located within the component,
keeping the view logic of a
component close to its
corresponding template
21. www.tothenew.com
Java Use-API enables a HTL file to access helper methods in a custom Java class.
1. Implementing Use interface:
public class HTLComponent implements Use {
@Override
public void init(Bindings bindings) {
Resource resource = (Resource)bindings.get("resource");
ValueMap properties = (ValueMap)bindings.get("properties");
// Parameters passed to the use-class
String param1 = (String) bindings.get("param1");
}
In AEM 6.2, io.sightly.java.api.Use is deprecated,
org.apache.sling.scripting.sightly.pojo.Use is used instead.
Java Use-API
22. www.tothenew.com
Java Use-API
2. Extend WCMUsePojo class:
public class HTLComponent extends WCMUsePojo {
private String myTitle;
@Override
public void activate() {
String text = get("text", String.class);
myTitle = "My Project " + text + getCurrentPage().getTitle()
+ “ : ” + getProperties().get("title", "");
}
public String getMyTitle() { return myTitle; }
}
In AEM 6.2, WCMUse is deprecated, com.adobe.cq.sightly.WCMUsePojo used
instead.
23. www.tothenew.com
• If the Java source file is in the same folder as the HTL file
<div data-sly-use.nav="Navigation">${nav.foo}</div>
Otherwise,
<div data-sly-use.nav="com.htl.model.Navigation">${nav.foo}</div>
• HTL Use-API resolution
Find a Java UseClass in the same directory OR with a fully qualified class name
Try to adapt the current Resource/Request to UseClass, if unsuccessful, try to
instantiate UseClass with a zero-argument constructor.
Within HTL, bind the newly adapted or created object to the localName.
If UseClass implements the Use interface then call the init method, passing the
current execution context (a javax.scripting.Bindings object).
UseClass extending WCMUse is a special case of implementing Use providing the
convenience context methods and its activate method is automatically called
from Use.init.
If UseClass is a path to a HTL file containing a data-sly-template, prepare the
template.
Otherwise, if UseClass is a path to a JavaScript use-class, prepare the use-class.
data-sly-use (cont.)
24. www.tothenew.com
• Enables a HTL file to access helper code written in JavaScript.
• Allows all complex business logic to be encapsulated in the JavaScript code, while the HTL
code deals only with direct markup production.
use(function () {
var Constants = {
DESCRIPTION_PROP: "jcr:description",
DESCRIPTION_LENGTH: 50
};
var title = currentPage.getNavigationTitle() || currentPage.getTitle() ||
currentPage.getName();
var description = properties.get(Constants.DESCRIPTION_PROP, "").substr(0,
Constants.DESCRIPTION_LENGTH);
return {
title: title,
description: description
};
});
data-sly-use JavaScript Use Api
25. www.tothenew.com
Client libraries helper template library
The client libraries helper template library
(/libs/granite/HTL/templates/clientlib.html) can be loaded
through data-sly-use and stored in a clientLib block element variable.
Loading the library's CSS style sheets and JavaScript is done
through data-sly-call. The clientLib template library exposes three
templates:
• css - loads only the CSS files of the referenced client libraries
• js - loads only the JavaScript files of the referenced client libraries
• all - loads all the files of the referenced client libraries
27. www.tothenew.com
• The <sly> HTML tag can be used to remove the current element, allowing only
its children to be displayed:
<sly data-sly-test="${event.hasDate}" >
<span>Hello</span>
</sly>
• Its functionality is similar to the data-sly-unwrap block element :
<div data-sly-test="${event.hasDate}" data-sly-unwrap>
<span>Hello</span>
</div>
Both Output :
<span>Hello</span>
• Although not a valid HTML 5 tag, the <sly> tag can be displayed in the final
output using data-sly-unwrap:
<sly data-sly-unwrap="${false}"></sly>
outputs: <sly></sly>
<sly> & data-sly-unwrap
29. www.tothenew.com
Display Context Option
The context option offers control over escaping and XSS protection.
• Allowing some HTML markup (filtering out scripts)
<div>${‘<p>Hello</p>’ @ context='html'}</div>
Without context :
<p>hello</p>
• Adding URI validation protection
<p data-link="${link @ context='uri'}">text</p>
• Applying CSS string escaping
<style> a { font-family: "${myFont @ context='styleString'}"; } </style>
30. www.tothenew.com
Display Context Option
Context Use
• html
• text
• elementName
• uri
• scriptString
• scriptComment
• scriptRegExp
• styleString
• styleComment
• comment
• number
• unsafe
Outputs HTML - Removes markup that may contain XSS risks
For simple HTML content - Encodes all HTML
Allows only element names that are white-listed, else outputs 'div'
To get valid Href link or path
Applies JavaScript string escaping
For JavaScript block comments
To apply JavaScript regular expression escaping
To apply CSS string escaping
For CSS comments
To apply HTML comment escaping
Outputs zero if the value is not a number
Disables XSS protection completely, use this at your own risk.
31. www.tothenew.com
String Format Option
Numbered parameters can be used for injecting variables:
${'Assets {0}' @ format=properties.assetName}
OR
${'Assets {0}' @ format=[properties.assetName]}
${'Page {0} of {1}' @ format=[current, total]}
Array Join Option
The join option allows to control the output of an ahorray object by specifying the
separator string. This can for e.g. be useful for setting class-names
${['one', 'two'] @ join='; '} <!--/* outputs: one; two */-->
<span class="${myListOfClassNames @ join=' '}"></span>
32. www.tothenew.com
Internationalization (@i18n)
To translate a string to the resource language:
${'Assets' @ i18n}
Two more options can be used with i18n:
• locale : Overrides the language from the source. For e.g.: en-US or fr-CH
• hint : Allows to provide some information about the context for the translators.
${'Assets' @ i18n, locale='en-US', hint='Translation Hint'}
33. www.tothenew.com
URI Manipulation
• Scheme - Allows adding or removing the scheme part for a URI :
${'example.com/path/page.html' @ scheme='http'}
outputs: http://example.com/path/page.html
${'http://example.com/path/page.html' @ scheme='https'}
outputs: https://example.com/path/page.html
• Domain - Allows adding or replacing the host and port (domain) part for a URI :
${'///path/page.html' @ domain='example.org'}
outputs: //example.org/path/page.html
${'http://www.example.com/path/page.html' @ domain='www.example.org'}
outputs: http://www.example.org/path/page.html
35. www.tothenew.com
URI Manipulation
Selectors / addSelectors / removeSelectors - Modifies or removes the selectors
from a URI:
${'path/page.woo.foo.html' @ selectors='foo.bar'}
outputs: path/page.foo.bar.html
${'path/page.woo.foo.html' @ selectors=['foo', 'bar']}
outputs: path/page.foo.bar.html
${'path/page.woo.foo.html' @ addSelectors='foo.bar'}
outputs: path/page.woo.foo.bar.html
${'path/page.woo.foo.html' @ removeSelectors=['foo', 'bar']}
outputs: path/page.woo.html
36. www.tothenew.com
URI Manipulation
query / addQuery / removeQuery- adds, replaces or removes the query segment of a URI,
depending on the contents of its map value :
assuming that jsuse.query evaluates to:
{
"query": {
"q" : "sightly",
"array" : [1, 2, 3]
}
}
${'http://www.example.org/search' @ query=jsuse.query}
outputs:
http://www.example.org/search?q=sightly&array=1&array=2&array=3
${'http://www.example.org/search?s=1' @ addQuery=jsuse.query}
outputs:
http://www.example.org/search?s=1&q=sightly&array=1&array=2&arra
y=3
${'http://www.example.org/search?s=1&q=sightly' @ removeQuery=['s', 'q']}
outputs: http://www.example.org/search
37. www.tothenew.com
URI Manipulation
• Extension - adds, modifies or removes the extension from a URI:
${'path/page.json?key=value' @ extension='html'}
outputs: path/page.html?key=value
${'path/page.json#fragment' @ extension='html'}
outputs: path/page.html#fragment
• fragment - adds, modifies or replaces the fragment segment of a URI :
${'path/page' @ fragment='fragment'}
outputs: path/page#fragment
${'path/page#one' @ fragment='two'}
outputs: path/page#two
${'path/page#one' @ fragment}
outputs: path/page
38. www.tothenew.com
Best practices
● Abuse of sly
● HTL comments instead of Html comments
● Reuse code using templates
● Use api to be used only when the HTL file alone is not enough to
implement logic
● Javascript use is slower than Java use class so use Javascript only for
less intensive logic
● Use local java use class if the class is used only for that component,
otherwise create a bundle use class
● Passing a parameter to a use-class should only be done when the use-
class is used in a data-sly-template file which itself is called from another
HTL file with parameters that need to be passed on.
39. www.tothenew.com
Moving from JSP to HTL
• Components written in HTL are compatible with components
written in JSP or ESP.
A JSP can include a HTL file like this,
• <cq:include script="footer.html"/>
and a HTL file can include a JSP like this,
<div data-sly-include="footer.jsp"></div>