Thanks, both solutions work perfectly of course. So if I want to make the macro version work for all Tiddlers, but only those tagged with “property”, how do I tweak the macro?
\define linkup()
<$list variable="." filter="[<currentTiddler>tag[property]]">
The property was built in: <$text text={{{ [<currentTiddler>has:field[built]then{!!built}] }}} />
</$list>
\end
…and put this in its own tiddler with the tag $:/tags/Macro
But if want something made to show in each tiddler automatically, it makes more sense to just put it as a ViewTemplate item:
<$list variable="." filter="[<currentTiddler>tag[property]]">
The property was built in: <$text text={{{ [<currentTiddler>has:field[built]then{!!built}] }}} />
</$list>
Put the above in a tiddler tagged with $:/tags/ViewTemplate
Since that was written, there have been some new tools added to the filter operator arsenal. In general, you can often use addprefix and addsuffix to perform concatenations. Also, there is now a map filter run prefix. So, this seems to work.
{{{ [<currentTiddler>has:field[built]] :map[{!!built}addprefix[The property was built in: ]] }}}
Another concatenation method I have started using a lot more, especially when building a tooltip, such as on a button, is the join opperator in a filtered transclusion. In many ways its the simplest and cleanest;
I think the first section could be kept. We introduced it, because it’s the intuitive but wrong way. … It may be moved to the end to be there as an example.
So starting from: The solution is to use a macro to put the rendered value of ,,, this and the rest of the content can be completely removed and be replaced … Really nothing after that makes much sense anymore.
Macros which use $variable$ or $(variable)$ can’t be cached. So if they are used in templates, or in large lists, they are less performant then a join filter will be.
At the moment we don’t have a good and easy to use alternative, but there is GH issue, that we should create one
Macros which use $variable$ or $(variable)$ can’t be cached so when designing templates or lists likely to have a lot of items, it is better to make use of the the “above” filtered transclusion and join operator for concatenating values because its much more efficient.
As a result you may want to use this method for concatenation “as a rule”
My feeling is the idea that simple replaceable parameters is to be discouraged is overkill and will deprive everyday users of simple code patterns that are easier to understand.
It may be a simple effort, if and when performance issues arise, to search for $variable$ or $(variable)$ and revise the code, because in most cases this will not be an issue.