Create a list from from Collection text

I have a text field in a collection that has comma separated entries. Example - Apple, Orange,Peach. I’m looking to make this into a list only when viewed.

  • Apple

  • Orange

  • Peach
    What is the best way I can go about doing this? Using code on each page or is it possible using a data hook before a query? Thanks.

You would have to use a .split code to break the text into smaller pieces.

You can look up the word ‘split’ in this forum to see what other examples you find.

I have a tutorial that uses this method (the tutorial itself is not teaching HOW to use the code, but it should help you understand a little bit of the logic behind the code).

You can check out any of these to see if they may help you: