Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

How to use Sling 2.0 taglib feature in sightly

Avatar

Level 4

Hi All,

We want to move to Sightly in our current AEM application. Is there a way I can use features provided by Sling 2.0 Taglib (http://sling.apache.org/documentation/bundles/sling-scripting-jsp-taglib.html ) inside my .html files?

Thanks!

Shehjad

1 Accepted Solution

Avatar

Correct answer by
Employee

It is not possible to do this. Please let me know what features specifically you are looking for.

View solution in original post

6 Replies

Avatar

Correct answer by
Employee

It is not possible to do this. Please let me know what features specifically you are looking for.

Avatar

Employee

Correct, with sightly you can't use taglibs.

Avatar

Level 4

Is there way .. we can  get instance of pagecontext in sightly class?

Avatar

Employee

Checked the object, but to me it seems that PageContext is for JSP only.

What are you trying to achieve?

Avatar

Level 4

Thank you very much for looking into it.

We are moving to Sightly for all the existing components which are developed in JSP

These existing JSP components connecting with the View Helpers which are java classes which are having logic to return the values to JSP.

These classes requires pageContext to be passed as their constructor argument.

To not to rework on the whole bunch of view helpers for the Sightly components, we are planning to create an instance of pageContext in the sightly class which extends WCMUsePojo.

Using that pageContext we can create the viewhelpers inside this class by passing this pageContext to the viewhelpers constructor.

Example what we are trying to do :

class SightlyHelper extebds WCMUsePojo {

//create a pageContext instance

ViewHelper helper = new ViewHelper(pageContextInstance)

}

So that we can use all viewhelper methods inside my Sightly component.