Shorten URL in model.json output | Community
Skip to main content
Level 5
June 7, 2018
Solved

Shorten URL in model.json output

  • June 7, 2018
  • 5 replies
  • 4208 views

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.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by joerghoh

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

5 replies

smacdonald2008
Level 10
June 7, 2018

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?

BigT168Author
Level 5
June 7, 2018

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?

joerghoh
Adobe Employee
joerghohAdobe EmployeeAccepted solution
Adobe Employee
June 7, 2018

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

smacdonald2008
Level 10
June 7, 2018

Thanks Joerg for clearing this up!

BigT168Author
Level 5
June 7, 2018

Make sense, Thanks.