Highlighted

URL shortening for /etc/designs

Avatar

Avatar

rubenf42159101

Avatar

rubenf42159101

rubenf42159101

23-01-2018

Hi,

I want to shorten the url for /etc/designs. I have created mapping under /etc/map

<?xml version="1.0" encoding="UTF-8"?>

<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"

    jcr:primaryType="sling:Mapping"

    sling:internalRedirect="[/etc/designs/myproject/components/$1]"

    sling:match="components/(.+)$"/>

I'm trying to use resourceResolver.map() to get the shortened url from etc mapping.

slingRequest.getResourceResolver().map(slingRequest, "/etc/designs/myproject/components/header.css");

slingRequest.getResourceResolver().map(slingRequest, "/etc/designs/myproject/components/header.js");

But I don't the shortened url for designs whereas I get shortened url for pages (/content/myproject).

Does sling support resourceResolver.map() for designs?

Thanks and Regards,

Ruben Fernando

Replies

Highlighted

Avatar

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K
smacdonald2008

23-01-2018

This is discussed in this thread - sling - AEM: URL Shortening - Stack Overflow

Highlighted

Avatar

Avatar

rubenf42159101

Avatar

rubenf42159101

rubenf42159101

23-01-2018

Hi,

Above thread mention about URL shortening for content pages. I'm looking for URL shortening for clientlibs (JS and CSS) through resourceResolver.map().

Does sling support resourceResolver.map() for designs(clientlibs)?

slingRequest.getResourceResolver().map(slingRequest, "/etc/designs/myproject/components/header.css");

slingRequest.getResourceResolver().map(slingRequest, "/etc/designs/myproject/components/header.js");

Thanks and Regards,

Ruben Fernando