Templates can get super complicated because the syntax has two major "problems"
1) Whitespace is important (you can't do carriage returns and tabbed alignment for readability, because that actually alters the result)
2) Its syntax is subject to Wiki syntax. {x} means something already, so does {{x}} which is why if statements look like this:
{{#if:{{{Input-link|}}}|{{{Input-link}}}|{{{Input}}}}}
Yes, that's actually an if-then-else statement.
Specifically, if the variable "Input-link" is not blank, then write it, else use the variable "Input" as the link destination.