Saturday, 10 October 2015

Creating Component using sightly

We have to follow basic two differences while creating the sightly component:

  1. Extension of the file should be .Html
  2. No inclusion of the global.jsp in the component file.

Follow those above steps while creating the component and create a component in the normal fashion

Project Structure:


Then include some of the data-sly attributes for the samples as below

Hello Welcome to sightly Components
<div data-sly-test="${currentPage.name}"> currenPageName:${currentPage.name} </div>


<div data-sly-test.author="${wcmmode.edit || wcmmode.design}">
Show this to the author in Edit and Design Mode
</div>
<div data-sly-test="${!author}">
    Show this in Publish Mode
</div>

In the Component you created 

Then next create a page with some template drag and drop the component into the template then you can see the output as Shown below 

This is how you can create a new sample sightly component..


Important Links:

https://github.com/Adobe-Marketing-Cloud/aem-sightly-repl
https://github.com/Adobe-Marketing-Cloud/aem-sightly-repl/releases/download/aem-sightly-repl-1.0.2/com.adobe.granite.sightly.repl-1.0.2.zip
https://docs.adobe.com/docs/en/aem/6-1/develop/sightly.html
http://adobeaemclub.com/guide-for-working-with-templates-and-call-in-sightly-aem-6-1/
http://adobeaemclub.com/movie-component-using-sightly-and-wcmuse-api-in-aem-6-1/

https://github.com/edubey1/atesightly
http://bit.ly/AEMHelpForum
http://bit.ly/AEMTechGroup
http://bit.ly/GzKDsp
http://adobeaemclub.com/sightly-pagination-component-using-sling-model-and-javascript-use-api-in-aem-6-1/
http://adobe-marketing-cloud.github.io/tag/aem/

Saturday, 23 May 2015

Intro to sightly

Objectives of sightly are:

  1. Giv­ing back the markup, and not mix­ing it with code.
  2. Every­thing is secure, by default.
  3. Smoothen the work­flow between the designer and the developer

Some the basic tags used in sightly:

  1. <div> currenPageName:${currentPage.name} </div>
  2. <div data-sly-test="${wcmode.edit}">This message is only shown in edit mode</div>
  3. <div data-sly-test.mode="${wcmmode.edit || wcmmode.design}"> This message is shown in edit and design mode </div><div data-sly-test="${!mode}">This message can be shown for other than edit and design modes</div>
  4. <div data-sly-text="${currentPage.title}">Default Title</div>
  5. <ul data-sly-list.childpage="${currentPage.listChildren}"><li>${childpage.path}</li><li>${childpage.title}</li></ul>
  6. <ul data-sly-list.childpage="${currentPage.listChildren}"><li class="${childpageList.odd ? 'odd' :'even'}"></li></ul>
  7. <div data-sly-resource="${ @path='par' , resourceType='foundation/components/parsys'}"></div>
  8. <footer data-sly-resource="${@path='usercomponent' , resourceType='project/usercomponent'}"></footer>
  9. ${pageProperties.jcr:title || properties.title || "No Title"}
  10. <div data-sly-include="{index.html or any index.jsp}"></div>