I'm trying to render SxaTags through Reference in Rendering Variants but it won't render in the front end. I'm trying this in a component that is cloned from the existing Promo component. Sitecore version is 9.2 with SXA 1.9
1 Answer
It works quite fine:
The problem you are having is probably related to the fact that you are using Promo rendering which uses its own data sources (not a page where the rendering is dropped - like for example Page Content). Which means you would need to tag Promo data source items (not pages) which make no sense...
-
So you mean SxaTags would not work for Promos? And will work only for components which don't use data sources? Is my understanding correct? Commented Oct 7, 2019 at 11:59
-
@SumitUpadhyay No... I'm just saying that Page Content is using the current page as the data source by default (when the data source field is empty). We have tags on the pages. When you are using Promo, the rendering variant for promo won't look for tags on the page, it will looks for tags on the Promo data source item (as promo is using it) but the tags are not there. Commented Oct 7, 2019 at 12:24
-
Yup I got it. But just wondering if there's anyway to make this work for Promo with a data source Commented Oct 7, 2019 at 18:01
-
You can do it, but you would need to extend Promo data source template with SxaTags filed (there is a base template for that). Commented Oct 8, 2019 at 10:47
-
1You are complicating your life. Just change the approach, start using tags on pages (like everyone...) and problem solve. Commented Oct 9, 2019 at 7:01