Conditional template not working

I am not a coding expert and I found this conditional template on youtube but it doesn’t work for me. It supposed to present us with the list of options from this file when the template is summoned. I cannot even play with it as I don’t understand the code. Can anyone help to revise code below please? It was written for previous version of Obsidian (like 8 months ago) so it might be a version issue:

<%-* const list = [“shoulderPress”, “sitUps”]
type = await tp.system.suggester(list, list) %>
<%-* if (typ === “shoulderPress”){%>log:: <% tp.file.cursor(1) %> - #shoulderPress #log/exercise/gym - :weight_lifting_man: <% tp.file.cursor(2) %>
<%-* } else if (type === “sitUps”){%>log:: <% tp.file.cursor(1) %> - #sitUps #log/exercise/gym - :weight_lifting_man: <% tp.file.cursor(2) %>
<%-* } else {%>log:: <% } %>

Thank you

You need to install and enable the Templater plugin, and I’d recommend reading its documentation.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.