So I can tag tiddlers with ‘short’ and clicking on it will open a tiddler titled “Not So Short”
I’m not sure you can do precisely that. But you can have tiddlers display their caption fields in place of their titles, so it will look like that.
By using the View Template Title Cascade, you can link to a template that will display the caption field in place of the title, if the tiddler has one. This would involve two tiddlers:
First is the template itself that will show the caption:
title: $:/_/my/core/ui/ViewTemplate/title/caption
\whitespace trim
<h2 class="tc-title">
<$view field="caption"/>
</h2>
Second is the cascade filter that will choose this template:
title: $:/_/my/config/ViewTemplateTitleFilters/caption
tags: $:/tags/ViewTemplateTitleFilter
[<currentTiddler>has[caption]then[$:/_/my/core/ui/ViewTemplate/title/caption]]
This latter also has to be sorted above the default title view. You can do this by adding a field:
list-before: $:/config/ViewTemplateTitleFilters/default
or by clicking on the $:/tags/ViewTemplateTitleFilter
tag pill and dragging around the values in that list.
Now tiddlers that have a caption will display that value instead of their title.
So we can write
title: My Tiddler
tags: Short
Something here
and
title: Short
caption: Not So Short
And you should get behavior close to what you’re looking for.
You can try this by downloading the following and dragging it onto a wiki.
ShortTagName.json (896 Bytes)
Note that the names of the template and the cascade configuration tiddler is arbitrary, although the config tiddler does include the name of the template. I choose to have them in the system namespace (i.e., beginning :/
), to use names very similar to the built-in ones, and to use a short namespace beginning with _/
, to keep my hidden tiddlers grouped together at the top of certain lists. None of that is necessary; I could name them Fred
and Wilma
if I choose.
I would say that there are solutions, and almost any behavior is possible — but the details depend on why you want this behavior.
If there’s a difference between the name you want on the tag pill and the actual title you want to attach to the home-node tiddler, that strikes me as very misleading and confusing, because the home-node tiddler does lots of things, such as house the list field that holds the custom order for the tag’s contents, etc. (You’d have to patch and override a whole lot of how the core directs its traffic to do that!)
It’s easier to have that home-node tiddler (and/or links to it) display however you like, even while it technically has a title field that corresponds to the tag. Displaying with the caption field, as suggested by @Scott_Sauyet, is one such trick.
Another is using the linkstyle package by @twMat, which allows you to modify how title links look. I recommend choosing the “display tiddler titles as links” setting in your control panel. That way, linkstyle gives you effective get ways to modify how your tiddler title bar area looks in the story river, and to modify how links look like wherever else links appear.
Here’s a working example of a tiddler displaying with extra explanatory text (in a different color, here) alongside the title. (This effect is achieved with the linkstyle-after
field.)
Feel free to say more about why you want this kind of solution, and that will help steer the conversation about what kind of modifications make sense.
I don’t want to type long names when tagging, but I don’t want a short/cryptic title for my tiddler.
Note the reason I want the tiddler’s title to be the long format (and not have the title be the short format and display a caption) is so it is also what appears in searches, completions, etc. I wan the special short form to be used for tags only.
Give this a try:
The <<tag>>
macro is defined in shadow tiddler $:/core/macros/tag
.
Edit that tiddler. In the tag-pill-inner
macro definition, find this line:
<$view tiddler=<<__tag__>> field="title" format="text" />
and replace it with:
<$view tiddler=<<__tag__>> field="shortname" format="text">
<$view tiddler=<<__tag__>> field="title" format="text" />
</$view>
You can then create or edit any tag tiddler (e.g, https://tiddlywiki.com/#TableOfContents) and add a shortname
field with your desired alternative display name.
Note that this name is only shown in the “tag bubble” when rendering the <<tag>>
macro. When you edit a tiddler to add a tag, you will still select the real tag title from the “tag picker” droplist in the tiddler editor.
enjoy,
-e