Expand my Community achievements bar.

SOLVED

Shorten URL in model.json output

Avatar

Level 6

Defined URL mappings in the Apache Sling Resource Resolver Factory of AEM 6.3 SP2, tested the url shortening in the Adobe Experience Manager Web Console Resource Resolve, it works fine.

However, when I run page.model.json, none of the URL is shortened. Not sure if this is the way how model.json works, not integrated with configuration. Or may in near future, there is an enhancement.

Please let me know.

At the same time, any suggestions to output the URL shortening, especially when I use core component, such as list component, to output a list of pages, I need the shorten URL.

Thanks.

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Hi,

that's indeed expected behaviour. In the HTML rendering the Link Rewriter does the URL shortening, while it does not kick in when you use Sling Model Exporter to export the very same Sling model.

The only chance I see is to do the shortening already in the Sling Model exporter (at the paths which need or can to be shortened at all).

Jörg

View solution in original post

5 Replies

Avatar

Level 10

TO shorten URLS - see Apache Sling :: Mappings for Resource Resolution

After you successfully shortne the URL - when you run the URL in a browser - does your page resolve?

Avatar

Level 6

in AEM 6.3, Adobe introduces the model.json. When you have a list of pages, you can put core list component as parent of these pages, then list.model.json will output some properties of each child page.

What I am asking is the model.json output the path and URL of each child page , but both path and URL are not shortened. Is this expected behavior?

Avatar

Correct answer by
Employee Advisor

Hi,

that's indeed expected behaviour. In the HTML rendering the Link Rewriter does the URL shortening, while it does not kick in when you use Sling Model Exporter to export the very same Sling model.

The only chance I see is to do the shortening already in the Sling Model exporter (at the paths which need or can to be shortened at all).

Jörg