Skip to content

Instantly share code, notes, and snippets.

@michaellwest
Last active October 29, 2021 12:58
Show Gist options
  • Select an option

  • Save michaellwest/87fedb002a104387438177faa325bcbc to your computer and use it in GitHub Desktop.

Select an option

Save michaellwest/87fedb002a104387438177faa325bcbc to your computer and use it in GitHub Desktop.
In Sitecore join SxaTags separated by comma using a Scriban template.
{{ if i_item.SxaTags != "" }}
<span>
Department:
</span>
{{ tags = [] }}
{{ for i_tag in (sc_followmany i_item "SxaTags") }}
{{ tags[tags.size] = i_tag | sc_field "Title" }}
{{ end }}
{{ tags | array.sort | array.join ", " }}
{{ end }}
@klawingco
Copy link

I just want to say THANK YOU for this. I can't seem to find documentation around printing SXATags using Scriban.

@michaellwest
Copy link
Author

michaellwest commented Oct 29, 2021

@klawingco
I also wrote an example on how to use Scriban with search.

https://sitecore.stackexchange.com/q/28748/95

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment