Expand my Community achievements bar.

SOLVED

Adobe Target VEC Selectors

Avatar

Level 1

Hi All, 

We are building an integration for our SPA websites with Target Visual Experience Composer. One thing I wanted to check if the CSS Selectors in VEC. In documentation, its mentioned that we can only use either ID, or CSS class or a default selector based on "Compose" option - https://experienceleague.adobe.com/en/docs/target/using/administer/visual-experience-composer-set-up

 

Is there an option to use custom data attribute, for example : data-cy= "button-tv-box"

 

RupalJa_0-1739285552977.png

Has someone used custom attribute for selector? 

 

Thank you in advance for your feedback

Best,

Rupal

 

1 Accepted Solution

Avatar

Correct answer by
Level 1

Hi @RupalJa ,

 

Once you pick the element on VEC editor, it will prompt selector value by default on the CSS element selector, There you can edit by adding data attribute and value like below,

RajeshManoharan_0-1739875326370.png

Hope this helps !

View solution in original post

5 Replies

Avatar

Level 9

@RupalJa  as a workaround you can have data attribute specific class and apply to DOM element where you are planning to use data-cy and within that class if apply attribute specific CSS selector to make it unique class 

Avatar

Level 1

Hi @RiteshYadav18 ,

Thank you for your response and the idea. At the moment, this is not possible since the development teams cannot change add the class right now. Hence, I was thinking is its possible to use data attributes. 

 

Best,

Rupal

Avatar

Level 9

@RupalJa in either case you have to apply CSS, so may be use VEC and apply required CSS  as inline CSS  to data attributes - this you can do without having dev/IT support 

Avatar

Correct answer by
Level 1

Hi @RupalJa ,

 

Once you pick the element on VEC editor, it will prompt selector value by default on the CSS element selector, There you can edit by adding data attribute and value like below,

RajeshManoharan_0-1739875326370.png

Hope this helps !

Avatar

Level 1

Thanks @RajeshManoharan , I checked it quickly and it worked. I will check more scenarios further.