Separator within cms items

Hello everyone,

i have a collection list with bibliographical details of books. in the design i would like to display the authors at the top and separate them with a “/”.

two problems:

  1. sometimes I only have one author, sometimes three or four.
    this means: the separator should only be inserted after the first author if at least one second author follows. no separator should follow after the last author.

  2. lastly, the year should be displayed in brackets. however, not every item has a year. in other words: the brackets should only be displayed if a year is present (similar to conditional visibility for items).

thanks for any help.

Would the way your collection is set up work to just include the slashes and brackets when typing the authors/year?

Hi Johannes,

If your Authors list is stored as a multiref to a separate collection, then you can render them on your page with a collection list that is bound to that multiref.

For the separators, you can use CSS. Here’s an example of how to do it as commas, but you can use whatever separator you want.

1 Like

@memetican - good call, I was approaching this with JS, which you could also do, something like this: https://codepen.io/samuel-g/pen/wvOzGNx

Yep, JS is always an option too, I try to minimize it for simple things, but also because a surprising number of engineers I know keep JS disabled. I think that would break most Webflow sites, even basic dropdown navs.