Use Case: Some common how to in Sightly
Prerequisite: Please read following document carefully before some other How to questions
Prerequisite: Please read following document carefully before some other How to questions
- Sightly Specification: https://github.com/Adobe-Marketing-Cloud/sightly-spec/blob/master/SPECIFICATION.md
- Basics of Sightly: https://docs.adobe.com/docs/en/aem/6-1/develop/sightly.html
- Sightly tutorials: http://blogs.adobe.com/experiencedelivers/experience-management/sightly-intro-part-1/ (Check other parts on same page)
- Sightly Presentation: http://www.slideshare.net/GabrielWalt/component-development
- Code Base: https://github.com/apache/sling/tree/trunk/bundles/scripting/sightly
Here is some common How to in sightly
How to include ClientLibs in Sightly
How to Loop fixed number of set in Sightly
How to create for or while loop in sightly
You can not have dynamic while loop directly in Sightly scripting. However you can use Use class to simulate while or for loop in Sightly. Here is example
How to reference other OSGI service in sightly
How to initialize a default value of a property in sightly
How to access string array in Sightly
How to create/access map in sightly
How to use Sling Model with Sightly
How to hide element in Sightly
<!--/* This will only show "Foo" (without a <div> around) if the test is true: */--> <div data-sly-test="${myTest}" data-sly-unwrap>Foo</div> <!--/* This would show a <div> around "Foo" only if the test is false: */--> <div data-sly-unwrap="${myTest}">Foo</div>
<!--/* This will display only the output of the 'header' resource, without the wrapping <sly> tag */--> <sly data-sly-resource="./header"></sly>
<sly data-sly-unwrap="${false}"></sly> <!--/* outputs: <sly></sly> */-->
How to pass a sightly object as parameter in Sightly
More use cases to come. Please suggest me any use case you want to get clarity on.
Some more useful Link:
- Creating First Sightly Component: https://helpx.adobe.com/experience-manager/using/creating-sightly-component.html
- Create a AEM project with Sightly Example: https://github.com/Adobe-Marketing-Cloud/aem-project-archetype
- Good Example of Sightly Application using Sling: https://github.com/nateyolles/publick-sling-blog
- Sightly To do App: https://github.com/Adobe-Marketing-Cloud/aem-sightly-sample-todomvc
- All Available Context and implicit object in JS and JAVA: http://aemtuts.com/aem-sightly-quick-reference/
- All Available global Object: https://docs.adobe.com/docs/en/aem/6-0/develop/sightly/global-objects.html
- Repl Tool: https://github.com/Adobe-Marketing-Cloud/aem-sightly-repl
- Bracket Extension: https://docs.adobe.com/docs/en/dev-tools/aem-brackets.html
- Eclipse Extension: https://docs.adobe.com/docs/en/dev-tools/aem-eclipse.html