2

Introduction

We are using Sitecore 9 Update 2 with SXA 1.7.1.

We have implemented "Download Center" using OOTB search components from SXA.

We would like to show "Title" value of Checklist field instead of GUIDs in Search Results.

We have already created our custom Rendering Variant but it only shows Ids.

Question

How we can show value of "Title" field instead of indexed GUIDs in search results?

enter image description here

Setup of solution

Custom Template that we have created (inherits Foundation interface template _Searchable + adds new fields): enter image description here

We have created hierarchy of tags under Data > Tags (we are refering to these from template as can be seen above):

enter image description here

This is how it looks like on items itself:

enter image description here

Rendering variant for Search Results (same is also for remaining fields):

enter image description here

How we should configure this to show Title field instead of GUID?

This is how the search results look now:

enter image description here

1
  • Did you try with a Reference in your variant? Checklist is not in the list of possible fields, but it works for other reference fields, so maybe also for this one.. I'll elaborate in an answer once I know it works with this type of field.
    – Gatogordo
    Sep 26, 2018 at 11:40

1 Answer 1

3

You can use a Reference in your variant.

Reference: displays field from referenced item. If you want to display a field from a referenced item, you can define this field in the PassThroughField. You can use this variant field for the following fields: LinkField (GeneralLink, DropLink), FileField (File), ImageField (Image), and ReferenceField (Droptree). Reference items can contain have another reference item as its child item. This can be convenient when you want to create a tree of reference items and display fields from items which are referenced in referenced items.

Although the official doc (as above) don't mention you fieldtypes, I just tested with a CheckList field and that worked just fine.

So: create in your variant definition a child of type "Reference". And underneath the reference, a child of type "Field". In the reference item pass the fieldname from your item (e.g. "Topic") and in the field item use the fienldname of the topic template (probably "Title").

0

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.