Basic passing variables between template and js

this is super easy and should work, I cannot figure out what’s wrong? I’ve been searching for the solution for hours…

Trying to display the template variable “link2” if it does not = “none”

currently i just want it to display link2 every time!