Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Sightly | Data attributes | Short URL

kamal_babum5800
Level 1
Level 1

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?

1 Accepted Solution
edubey
Correct answer by
Level 10
Level 10
4 Replies
Arun_Patidar
Community Advisor
Community Advisor

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

edubey
Correct answer by
Level 10
Level 10
kamal_babum5800
Level 1
Level 1

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