I think, that’s the way it should be done. I did move the thread to the HowTo category. I think it belongs there. … except you want it to be in discussions
This example also uses caption before the title if it exists.
What is interesting is the field can be the “title” to bypass the caption. But also you can use “text” which results in a form of transclusion that is linked to the source tiddler.
However to further the discussion here is how I would enhance the original macro;
The above defaults to current tiddler so it can be used in any list that changes the currentTiddler, it also defaults to caption, the natural alternative to title. Not also how I depart from the <<__param__>> style, somehow I never became comfortable with that.
Now here is an alternative which does the value nesting in a filter;
Based on the value of using the ideas in this thread to create a link to the tiddler, but by displaying the text, not unlike a transclusion, I have made this macro to display a tiddlers “text” content and a link to the tiddler in question.
\define content-link(tiddler)
<$set name=tiddler value="$tiddler$" emptyValue=<<currentTiddler>> >
<$button tag=div to=<<tiddler>> tooltip="Click to open source"><$transclude tiddler=<<tiddler>>/></$button>
</$set>
\end
<<content-link test>>
It could be extended to use another or any field like the last nested fieldnames, eg an excerpt field. Or get smarter and open the target for edit with ctrl-click, or open below (without navigating to it, with shift-click.
The nice thing is when using fields the {!!fieldname} implies the current tiddler, making the code even simpler and somewhat more readable and self documenting.
I was forced to use the !is[blank] but possibly trim could also do it. Perhaps if we had firstnonblank[] operator.
The changes let you pick a specific field, and add additional text if you want, or to just show as the field value.
So if you have a tiddler titled “JeremyRuston” with a initials of “JR”, you could put <<Linkify initials JR Jeremy>> and it will create a link of “Jeremy” to that tiddler. If you just wanna show their initials, you can just do <<Linkify initials JR>> and there ya have it.
I found it pretty handy for super long tiddler names. something like <<Linkify initials JR {{!!title}}>> would allow you to show the full title, but only need to type out whatever the field value you choose is.