Hi Jan,
the following snippet should do what you are after:
//{{{
Tiddler.prototype.TWCore_getSubtitle = Tiddler.prototype.getSubtitle;
Tiddler.prototype.getSubtitle = function() {
var desc = store.getTiddlerSlice(this.title, "tooltip");
if (!!desc) {
return desc;
} else {
var tags = store.getTiddler(this.title).getTags();
var tagList = tags.readBracketedList().join(", ");
return "Tags: " + tagList;
}
};
//}}}
One suggestion: Maybe it would be better not to define tooltips with hidden
slices but with a custom field which could be edited in edit mode
(EditTemplate)? If you like, I could rewrite this snippet to support both
options > slice and custom field (both named tooltip)?
Have fun,
Albert
Am Samstag, 17. Mai 2014 21:44:15 UTC+2 schrieb Jan:
>
> Hello all!
> I found a part of the solution for my tooltip-problem:
> Searching through the Archive of this group I found a solution for the
> problem of changing the tooltip by a defined slice stored in each Tiddler
> posted by Eric some time ago:
>
> 1) Put the following javascript code into a tiddler, tagged with
> systemConfig, then save-and-reload your document
> //{{{
> Tiddler.prototype.TWCore_getSubtitle=Tiddler.prototype.getSubtitle;
> Tiddler.prototype.getSubtitle = function() {
> return store.getTiddlerSlice(this.title,'tooltip')||this.
> TWCore_getSubtitle();
> };
> //}}}
>
> 2) To override the default tooltip for a given tiddler, add a "tooltip:"
> slice entry into that tiddler's text, like this:
> /%
> tooltip: this is the custom text
> %/
>
> Note the use of /% and %/ comment markers surrounding the slice
> definition. This prevents the embedded slice definition from being
> displayed in the tiddler output.
>
> *My question now **is:*
> *How can I modify this Code to show the Tags, if there is no tooltip-slice
> yet?*
>
>
>
>
> Thanks a lot for help
> Jan
>
>
>
--
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 http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.