Hi Eric,

Thanks for your explainer. But there's something wrong with your macro 
definition. It seems to want the tiddler= attribute rather than the 
combined field=tiddler!!field. 

Also, is the idea that only the caption OR the title shows up? I could fix 
it, but it would show both caption and title when both were available. 

I don't suppose there's a simple way to make a macro that can do if/else 
choices? 

It's a basic database design requirement that key linking fields be 
immutable. Title fields should float on top of the data independently so 
they can be freely altered as the use case is refined. I guess if I was 
going to depend on a macro solution I would want one that would create 
links based on a separate id field. But I suppose the link macro would have 
to do some sort of expensive field search so ... I don't know.

Thanks!
Mark
 



On Monday, March 7, 2016 at 11:30:00 AM UTC-8, Eric Shulman wrote:
>
> On Monday, March 7, 2016 at 10:16:51 AM UTC-8, Mark S. wrote:
>>
>> The little arrow buttons give an NS_ERROR_FAILURE message.
>>
>> The problem with linking/transcluding via titles is that then you either 
>> have to stick with that title forever or be willing to go back and edit all 
>> the places it is referenced. I often find myself wanting to change a title 
>> -- sometimes the muse just isn't there when you're doing your first draft. 
>> As a consequence, I rarely use the linking feature.  It would be useful if 
>> there were a way to link via some ID field which would never have to change.
>>
>
> Use of a special "unique tiddler ID" field has been suggested many times, 
> for both TiddlyWiki Classic and TiddlyWiki5.  Typically, after much 
> discussion of alternative architectures and backward compatibility, we 
> generally come back to the fact that TiddlyWiki already has a field that 
> holds a unique ID for each tiddler: the *title* field, and that what is 
> really being discussed is a distinction between a tiddler's ID and the 
> title that people see.
>
> In TiddlyWiki5, the "caption" field can be used to provide that 
> distinction.  For example, in the <<tabs>> or <<toc>> macros, if a tiddler 
> has a caption field, then that text is displayed as the tab title or table 
> toc link text, respectively.  Note that this is simply a TW core standard 
> *convention*.  There is no requirement for a tiddler to have a caption 
> field and, by default, only some of the core functions use the caption 
> field.
>
> For your purposes, you could extend this default usage to display the 
> caption text in place of the title text, by modifying the 
> $:/core/ui/ViewTemplate/title shadow definition, and replace
> <$view field="title"/>
> with
> <$view field="caption"><$view field="title"/></$view>
>
> For links, you could just use *pretty link syntax* to show the desired 
> text, while using the title "ID" as the link target:
> [[this is what the reader sees|TiddlerID]]
> or, alternatively, you could use a "caption link" macro to assemble a link 
> using the target tiddler's caption text, like this:
> \define clink(tid)
> <$link to="""$tid$"""><$view field="""$tid$!!caption"""><$view field=
> """$tid$!!title"""/></$view></$link>
> \end
> which you would invoke like this:
> <<clink TiddlerID>>
>
> There are probably some other places where you might want some 
> customizations, but once you have tweaked things to suit your needs, you 
> can just think to yourself "title = ID.... caption = display text".  Of 
> course, if you don't provide a caption on a given tiddler, everything 
> should fall back nicely to using the title text as the display text, just 
> as before.
>
> Hope this helps,
>
> enjoy,
> -e
> Eric Shulman
> TiddlyTools / ELS Design Studios
> InsideTiddlyWiki: The Missing Manuals
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/3372dd67-779b-48cf-bf08-b181d52648af%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to