Displaying caption instead of title in lists

in the discussion, Displaying the caption instead of title in TW 5.2.1+ using the new cascade filters, there is a nice way of displaying a caption instead of the title of a tiddler in cases where the title may be confusing, obtuse, etc.

However, I have found that although this works for the display of the tiddler itself using the viewtemplate facility, if I click on a tag pill and display all tiddlers having that tag, the title is displayed rather than the caption.

Is there any way to change this and if so how?

bobj

1 Like

The contents of the tag drop list are rendered by the list-tagged-draggable macro, which is defined in the $:/core/macros/list shadow tiddler.

To change the way those titles are rendered:

  • Edit $:/core/macros/list
  • Scroll down to the list-tagged-draggable macro definition
  • Find this line: <$view field="title"/>
  • and replace it with: <$transclude field="caption"><$view field="title"/></$transclude>

enjoy,
-e

3 Likes

Thank you @EricShulman . One quick question. Your solution causes the shadow tiddler to be edited and hence in a future software upgrade, this change will be lost. Can this change b made persistent in TW core for future versions?

Bobj

Actually, its the other way around…

When you modify a shadow tiddler, it is saved as a “real” tiddler that supersedes the shadow tiddler. If you subsequently upgrade the TWCore, it might include changes to that shadow tiddler, but your modified tiddler will still be present and continues to supersede the underlying shadow tiddler.

Of course, this can still be problematic in that you won’t be using the updated shadow tiddler, so any enhancements or fixes contained in that shadow tiddler won’t be applied in your TiddlyWiki.

-e

@EricShulman I have found another issue with using captions (at least in my use case).

I have two guns in Darwin, both are Miriam kecil guns.

So, I have two entries, NT1 and NT2, to ensure titles are unique but display the caption, Darwin - Miriam kecil, in both cases. So now, ‘title’ displays are meaningful.

Your suggestion above ensures that captions are displayed in the tag pill popup. Great except for the edited shadow tiddler copy, whose change must be re-done in the updated shadow tiddler to ensure all updates to the TW core are available with a deletion of the old edited shadow copy.

However, if I want to hyperlink to one of these items, I must use the NT1/NT2 title text as this is the only way to distinguish between the items. But this text is not displayed and so how does the user find out which one it is to link to? They must display the edit version of the target item to get its actual title.

This is cumbersome to be almost unreasonable in my view and subject to accidental edit of the tiddler.

So, my only way out is to concatenate a title using the unique code, eg NT1, and the caption text so the title as displayed is now NT1: Darwin Mirian kecil.

I can’t see any other way out.

bobj

Indeed. The issue is that, while tiddler titles must be unique, caption text can be identical for two (or more) tiddlers. Thus, displaying only the caption text leads to ambiguity.

As you’ve noted, one way to address this is to concatenate the title and caption for display purposes:

<$view field="title"/>: <$transclude field="caption"/>

However, this can produce unwanted “clutter” in the list.

Another way is to use the title text as a tooltip for the surrounding $link widget

<$link to={{!!title}} tooltip={{!!title}}>
	<$transclude field="caption"><$view field="title"/></$transclude>
</$link>

Of course, this still may result in ambiguous link display when two or more tiddlers have the same caption; however, the only action needed to differentiate the tiddlers is to hover the mouse over the link, which shows the actual tiddler title as a tooltip.

-e

Hi Bob. You could also give my uni-link plugin a try. uni-link — extended link functions

You will still need unique titles, but the allies links have a toolbar butten with a dialogue that can search for aliases. So your users only need to know part of the alias.

It would still make sense to create a consistent naming mechanism

Just an idea

Thanks @pmario I’ll have a look

Bobj