Creating custom HTL/Sightly RuntimeExtensions

Avatar

Avatar
Boost 1
Level 1
joshdboyle
Level 1

Like

1 like

Total Posts

6 posts

Correct reply

0 solutions
Top badges earned
Boost 1
View profile

Avatar
Boost 1
Level 1
joshdboyle
Level 1

Like

1 like

Total Posts

6 posts

Correct reply

0 solutions
Top badges earned
Boost 1
View profile
joshdboyle
Level 1

21-02-2017

For a client, I'm wanting to create a custom RuntimeExtension for HTL.  For example, similar to how i18n works in HTL expressions, I'd like to create my own.

I've traced out how HTL markup is actually compiled into Java and have seen how, for example, i18n makes its way into that Java, but I can't seem to get a custom RuntimeExtension to be acknowledged.  We are running AEM 6.1 SP2 but some direction to implement such a custom RuntimeExpression in either 6.1 or 6.2 would be great.

Some quick questions:

1) Is there something special I have to do to register a custom extension and, if so, where/how do I do this?  I see the ExtensionRegisteryService but it appears to simply pulling in any instances of RuntimeExtensions that are available.  How do I make my custom RuntimeExtension "visible" to the ExtensionRegistryService?

2) Is there anything I need to provide other than just the custom RuntimeExtension?  I see that i18n has an i18nFilter as well.  Do I need to write a filter for my custom extension?

I'll keep poking around and will report back if I find the solution but any help in the meantime would be greatly appreaited.  Thanks! 

Replies

Avatar

Avatar
Level 1
andreys65704577
Level 1

Likes

0 likes

Total Posts

2 posts

Correct reply

0 solutions
View profile

Avatar
Level 1
andreys65704577
Level 1

Likes

0 likes

Total Posts

2 posts

Correct reply

0 solutions
View profile
andreys65704577
Level 1

14-11-2017

I guess that for now it is not possible, because you should register this extension in Sightly compiler.

But for now it is a final class with whole configuration in its constructor

Avatar

Avatar
Give Back
Level 1
jeroen-ida
Level 1

Likes

0 likes

Total Posts

1 post

Correct reply

0 solutions
Top badges earned
Give Back
View profile

Avatar
Give Back
Level 1
jeroen-ida
Level 1

Likes

0 likes

Total Posts

1 post

Correct reply

0 solutions
Top badges earned
Give Back
View profile
jeroen-ida
Level 1

27-04-2020

I also want to do this, is this possible nowadays?