Skip to main content
New Member
Jul 20, 2018 7:36 PM UTC
Solved

Sightly | Data attributes | Short URL

Hi,

I'm working on sightly based component development. where i want to set the data attributes with short URL

I tried using JS which works only anchor tags but not for data attributes.

   var resourceType = resource.getResourceType();

     if(resourceType == "cq:Page"){

    resolved = resolved + ".html";

      }

Any alternate for data attributes?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
edubey
edubeyAccepted solution
Level 10
Jul 21, 2018 6:45 AM UTC

4 replies

arunpatidar
Community Advisor
Community Advisor
Jul 20, 2018 10:04 PM UTC

Hi,

What do you mean by short URLs? is it Vanity URLs?

Can you please explain more what output you expecting using sightly?

Thanks

Arun

Translate
Arun Patidar
edubey
edubeyAccepted solution
Level 10
Jul 21, 2018 6:45 AM UTC
New Member
Jul 23, 2018 3:52 PM UTC

Thanks, will try this

Translate
New Member
Jul 23, 2018 4:05 PM UTC

Hi

I tried data-attributes in anchor tag as below

href="${resolve.resolvedLink}"

data-sly-attribute.data-values="${resolve.resolvedLink}"

in href : i could short url as /home.html

where as in data-values  : /content/.../en/home.html

I need to update anything in configuration ??

Translate