microsoft-search / pnp-modern-search

Home of PnP Modern Search solutions, helping you move from classic to modern SharePoint and beyond
https://microsoft-search.github.io/pnp-modern-search
Other
380 stars 338 forks source link

Display issue of SharePoint tags on card view of PnP Modern Search #3797

Closed FelloSimon closed 3 months ago

FelloSimon commented 3 months ago

Hello,

I want to display the tags assigned to each document on the card views but by doing so (through "manage card fields", the entire internal name stays visible. I already switced on "Enable Localization".

image

Does someone has any idea what handle bar or setting I have to configure to only display the part after "|"?(aka the tag name)

Tags on the first card should be "Marketing" and "Policy". Tags of the second card should be "Projects" and "Policy". Tags of the third card should be "Projects" and "Policy".

Thanks

wobba commented 3 months ago

See details about "Enable localization" at https://microsoft-search.github.io/pnp-modern-search/usage/search-results/data-sources/#source-configuration

kasperbolarsen commented 3 months ago

If you map a RefinableString to the crawled properties you have a choice, either map to the taxid one, and get the entire property, or to the one without the taxid, and in that case you get the term label value in the RefinableString. If you have multi language terms and need to show those, you cannot use the approach above.

sympmarc commented 3 months ago

The important part of the instructions @wobba pointed you to, @FelloSimon, is this section:

_To use translated values in your template, you must use the 'Auto + ' property format instead of the original property name. For instance, to use translated values of the 'owstaxidmetadataalltagsinfo' property, you must use the 'Autoowstaxidmetadataalltagsinfo' auto created property._

You do this by customizing layout slots (screenshot 1) and adding the Auto the prefix (screenshot 2)

Does that solve your issue?

image

image

FelloSimon commented 3 months ago

See details about "Enable localization" at https://microsoft-search.github.io/pnp-modern-search/usage/search-results/data-sources/#source-configuration I already switced on "Enable Localization".

FelloSimon commented 3 months ago

The important part of the instructions @wobba pointed you to, @FelloSimon, is this section:

_To use translated values in your template, you must use the 'Auto + ' property format instead of the original property name. For instance, to use translated values of the 'owstaxidmetadataalltagsinfo' property, you must use the 'Autoowstaxidmetadataalltagsinfo' auto created property._

You do this by customizing layout slots (screenshot 1) and adding the Auto the prefix (screenshot 2)

Does that solve your issue?

image

image

Yes this worked out! Thanks a lot.

image