Highlighted

URL shortening for /etc/designs

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

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