Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Link check transformer with Dataprops

Avatar

Level 2

Hi Team,

 

Is there any way we can transform the Data-props href URL links using link check transformer if the component rendering using client side rendering and the props are available as data-props in DOM for react frame work to render.

I have a component which rendering DOM as below

Ex: data-props="{"lpos": "zip","theme": "light", "alignment": "center", "buttonText": "ZIP","priority": "primary","href": "/content/brand/country/private/promo/zip"
}}"

the alias values mapped for href link pages mentioned as private=privat and promo=Forderung and zip=plz

 

Now in dispatcher is it possible have link check transformer to convert the URL from /content/brand/country/private/promo/zip to /content/brand/country/privat/Forderung/plz

so that end user will access will see the alias matched URL instead of the original URL. The same working if we use sightly component with serverside but do we have any option in this scenarios?

 

 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @vasgurug 
1. It will not impact other transformers since they execute sequentially.
2. There might be a slight performance degradation if you run complex logic within the transformer implementation. For instance, the Link transformer checks all href attributes and appends .html. The performance impact will depend on the complexity of your custom logic.

 

Moreover, compared to JavaScript logic, Sling rewriters can offer better performance because the modifications are applied on the server side only once during page output generation and then cached at the dispatcher.



Arun Patidar

View solution in original post

4 Replies

Avatar

Level 2

Thanks @arunpatidar  for the reply.

Two questions 1. if we use sling transform factor to serialize the output as an HTML apache sling rewriter will this have any impact on the existing link check transformer?

2.If each and every href while transforming need to go through this rewrite process will this have any performance impact if large number of components contains multiple href? 

 

Avatar

Correct answer by
Community Advisor

Hi @vasgurug 
1. It will not impact other transformers since they execute sequentially.
2. There might be a slight performance degradation if you run complex logic within the transformer implementation. For instance, the Link transformer checks all href attributes and appends .html. The performance impact will depend on the complexity of your custom logic.

 

Moreover, compared to JavaScript logic, Sling rewriters can offer better performance because the modifications are applied on the server side only once during page output generation and then cached at the dispatcher.



Arun Patidar

Avatar

Administrator

@vasgurug Did you find the suggestions from users helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!



Kautuk Sahni