Seems better, but still not rendering as expected.
the following:
{{#vardefineecho:HtmlLink|nowiki <htmltag tagname="a" href="/index.php/Portal:Tag?Tag={{{1}}}"> /nowiki}}
(note, the nowiki tags above ARE surrounded with < and >, but if i include them here then you cannot see the nowiki tags here)
renders, on the template page, as:
<htmltag tagname="a" href="/index.php/Portal:Tag?Tag={{{1}}}">
which is the desired wikitext.
Next, that output should then get parsed as normal wikitext in the template, where #var appears.
But, output of #var is not getting parsed as wikitext in the template, it's just getting rendered on the host-page verbatim, as if it's not wikitext.
It seems the nowiki
tag in the #vardefine
prevents the output of #var from getting parsed as wikitext.
Any ideas?