2

I have a list of item and by using reference variant, I'm able to loop the items with the multi-list values. Now each tile which is displayed should wrap with two fields (ie., image and title) with anchor tag that points to context item on clicking this should open a details page of that tile.

enter image description here

Now that problem is after check the "islink" with the wrapping of anchor (<a>) between two fields and the link which is generating the relative URL is from (site tenant/Site/Home) instead of excluding till start item path as shown below:

Actual URL: http://domainname/sitetenant/sitename/home/Company/..../..../..../itemname

Expected URL:http://domainname/Company/about/..../..../itemname

Please suggest a way to generate a context item URL excluding start item path.

Using SXA 1.8 on 9.0.2 sitecore.

3

1 Answer 1

0

If you can go for Scriban template to create your rendering variant, sometihng like below code would help to achieve this:

    <div class="Title">
     <a href="{{i_item.url}}"> 
        {{ i_item.Title }} 
        {{ i_item.Image }}
      </a>
    </div>

This is just a reference code and I have not tested. Please let me know if you need more info.

Hope this helps someone!!!

Your Answer

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

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