Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list

Creating custom HTL/Sightly RuntimeExtensions


Level 1

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! 

2 Replies


Level 1

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

The ultimate experience is back.

Join us in Vegas to build skills, learn from the world's top brands, and be inspired.

Register Now