0

I'm trying to get a prefix in the wrapped url using a SXA variant

  1. ItemLink is a general field type
  2. ItemLink added in wrapped variant

This image is a custom component not using sxa variant feature so I want the same in sxa variant feature

enter image description here

Below is the image related to sxa variant:

enter image description here

enter image description here

enter image description here

2
  • 1
    Which version are you using? (asking to know if you can use Scriban templates)
    – Gatogordo
    Dec 7, 2022 at 8:50
  • sitecore 10.2 version, I want to achieve in variant feature
    – md shahbaj
    Dec 7, 2022 at 16:36

1 Answer 1

0

You should use the Scriban template variant to achieve this. More info on this for 10.2: https://doc.sitecore.com/xp/en/developers/sxa/102/sitecore-experience-accelerator/scriban-templates.html

This way you are using variants and do not need custom code.

I tried using tokens in such variant fields once (https://ggullentops.blogspot.com/2018/10/using-tokens-in-sitecore-sxa-variant.html) but bumped rather quickly to the limitations. You can always try extending this with custom code but I see absolutely no reason to do it when there is an ootb solution with Scriban.

ps: note that you can combine Scriban with the other variant types so you can limit the template to any (small) part you would like

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.