[TW5] Tag "alias" in connection with a navigating TOC

161 views
Skip to first unread message

The Bo

unread,
Apr 6, 2016, 5:57:29 AM4/6/16
to TiddlyWiki
Hey,

I'm looking for a way to set some kind of an "tag alias" for my current project.

The problem is that I'm using an expandable-toc for navigation where I have to use very large titles, e.g.:

01 personal management
>011 application (tag: 01 personal management)
>012 ...

To make it a bit more user-friendly it would be perfect to tag "01" instead of "01 personal management".

I would really appreciate your comments and suggestions!

Kind regards
The Bo


Eric Shulman

unread,
Apr 6, 2016, 7:07:53 AM4/6/16
to TiddlyWiki
On Wednesday, April 6, 2016 at 2:57:29 AM UTC-7, The Bo wrote:
I'm looking for a way to set some kind of an "tag alias" for my current project.

The problem is that I'm using an expandable-toc for navigation where I have to use very large titles, e.g.:

01 personal management
>011 application (tag: 01 personal management)
>012 ...

To make it a bit more user-friendly it would be perfect to tag "01" instead of "01 personal management".

Here's an alternative approach:

* title your tiddlers with the short code numbers
* use the caption field to provide the longer text

The <<toc-*>> macro automatically uses the caption field if present (with fallback to the title).

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios
InsideTiddlyWiki: The Missing Manuals

The Bo

unread,
Apr 6, 2016, 8:32:44 AM4/6/16
to TiddlyWiki
Hey,

in this case I would miss the titles of open tiddlers.

Regards
The Bo

Eric Shulman

unread,
Apr 6, 2016, 8:54:18 AM4/6/16
to TiddlyWiki
On Wednesday, April 6, 2016 at 5:32:44 AM UTC-7, The Bo wrote:
in this case I would miss the titles of open tiddlers.

You could tweak the $:/core/ui/ViewTemplate/title and replace
<$view field="title"/>
with
<<toc-caption>>
so that the caption text is also displayed at the top of the open tiddler.

-e

The Bo

unread,
Apr 7, 2016, 4:45:28 AM4/7/16
to TiddlyWiki
Hey Eric,

my first idea was, this works perfect for me.
But now I see that if I search for "personal management" I will get no hit. Even if I search for "01" I won't see the caption.

Regards
The Bo

RichardWilliamSmith

unread,
Apr 7, 2016, 9:58:33 AM4/7/16
to TiddlyWiki
Hi The Bo,

If you overwrite the core tiddler $:/core/ui/DefaultSearchResultList, you can add a section to make it search the caption field too.

\define searchResultList()
//<small>{{$:/language/Search/Matches/Title}}</small>//
<$list filter="[!is[system]search:title{$(searchTiddler)$}sort[title]limit[250]]" template="$:/core/ui/ListItemTemplate"/>
//<small>Caption Matches</small>//
<$list filter="[!is[system]search:caption{$(searchTiddler)$}sort[title]limit[250]]" template="$:/core/ui/ListItemTemplate"/>

//<small>{{$:/language/Search/Matches/All}}</small>//
<$list filter="[!is[system]search{$(searchTiddler)$}sort[title]limit[250]]" template="$:/core/ui/ListItemTemplate"/>
\end
<<searchResultList>>

This is quite hacky - you'd need to re-do it each time you upgrade to a new version - but I'm not sure what the preferred way to over-ride the UI actually is.

Regards.
Richard

The Bo

unread,
Apr 8, 2016, 5:40:22 AM4/8/16
to TiddlyWiki
Hi Richard,

Your hint is very good. I would prefer to implement it into "matches title" and "matches all" search maybe as a fallback from caption to title.

I already found a way to show the caption with a fallback to title at the results by changing the $:/core/ui/ListItemTemplate

<$view field="title">
to
 <$view field="caption"><$view field="title">

Regards
The Bo
Reply all
Reply to author
Forward
0 new messages