Sightly | Data attributes | Short URL | Community
Skip to main content
New Member
July 20, 2018
Solved

Sightly | Data attributes | Short URL

  • July 20, 2018
  • 4 replies
  • 2245 views

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.

4 replies

arunpatidar
Community Advisor
Community Advisor
July 20, 2018

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

Arun Patidar
edubey
edubeyAccepted solution
Level 10
July 21, 2018
New Member
July 23, 2018

Thanks, will try this

New Member
July 23, 2018

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 ??