Replace "Tagging:" with title.

10 views
Skip to first unread message

Alex Hough

unread,
Feb 4, 2008, 5:02:01 PM2/4/08
to Tiddl...@googlegroups.com
Hello there.

I am trying to get "Tagging:" to be replaced by the title of the tiddler. Then I want to remove the title on my view template.

I have followed eric's advice and have a tiddler called ConfigTweaks. I have attemped to alter this bit, but with no joy:


merge(config.macros.tagging,{
label: "tagging: ",
labelNotTag: "not tagging",
tooltip: "List of tiddlers tagged with '%0'"});


Any help much appriciated.

Alex


FND

unread,
Feb 4, 2008, 5:08:23 PM2/4/08
to Tiddl...@googlegroups.com
> I am trying to get "Tagging:" to be replaced by the title of the tiddler.

Why not just modify the ViewTemplate - replace the following line:
<div class='tagging' macro='tagging'></div>
... with this:
<div class='title' macro='view title'></div>

Though I'm not sure whether this is what you're actually after - maybe
you just want the title to be floated to the left? Try adding something
like this to your StyleSheet:
---------------
.tiddler .title {
float: left;
border: 1px solid [[ColorPalette::TertiaryLight]];
padding: 5px;
background-color:[[ColorPalette::TertiaryPale]];
}
---------------

HTH.


-- F.

Alex Hough

unread,
Feb 4, 2008, 5:26:41 PM2/4/08
to Tiddl...@googlegroups.com
Hi FND,

What i want to do is to replace the text "tagging:" above the list of tiddlers with the title of the tidder.

I want the taggin macro, but to change the "tagging:" label with the name of the tiddler in the same style of text that "tagging:" has.

Alex

Alex Hough

unread,
Feb 4, 2008, 5:32:34 PM2/4/08
to Tiddl...@googlegroups.com
I made a typo above!

I want the tagging macro, but to change the "tagging:" label with the name of the tiddler in the same style of text that "tagging:" has.

FND

unread,
Feb 4, 2008, 5:36:37 PM2/4/08
to Tiddl...@googlegroups.com
> I want the tagging macro, but to change the "tagging:" label with the
> name of the tiddler in the same style of text that "tagging:" has.

Oh right, of course.
Try adding the following code to a tiddler tagged with "systemConfig":
http://tiddlywiki.pastebin.com/f6a0a97d1
This overrides the default tagging macro - that's not a pretty solution,
but I don't think there's a simple, clean solution here.

HTH.


-- F.

Alex Hough

unread,
Feb 4, 2008, 5:47:13 PM2/4/08
to Tiddl...@googlegroups.com
I've done it!

In a tiddler "configTweaks , tagged with systemConfig i put:

config.macros.tagging.label="'%0'";

Alex

I'll give yours a look too.
Thanks for help

On 04/02/2008, FND <FN...@gmx.net> wrote:

FND

unread,
Feb 4, 2008, 5:50:46 PM2/4/08
to Tiddl...@googlegroups.com
> config.macros.tagging.label="'%0'";
> [...]

> I'll give yours a look too.

Don't bother - if yours works, that's a *much* better solution then.
Nicely done.


-- F.

Eric Shulman

unread,
Feb 4, 2008, 5:56:05 PM2/4/08
to TiddlyWiki
> I am trying to get "Tagging:" to be replaced by the title of the
> tiddler. Then I want to remove the title on my view template.

The trick is to re-assign the
config.macros.tagging.label
value EACH time a <<tagging>> macro is rendered.

To do this, you can use a "computed parameter" (e.g., {{...}}) in the
tagging macro call to perform 'side-effect' processing: the param
isn't actually used by the macro handler, but instead, simply sets the
global *.tagging.label value to the current tiddler title, so that
when the handler does it's job, the label has already been set to the
current tiddler title.

First, in your [[ViewTemplate]], replace:
<div class='tagging' macro='tagging'></div>
with:
<div class='tagging' macro='tagging
{{config.macros.tagging.label=tiddler.title}}'></div>

Then, for this particular usage, you will also need to install:
http://www.TiddlyTools.com/#CoreTweaks
Specifically for the tweak that hijacks InvokeMacro(), so that the
global 'tiddler' and 'place' variable can be automatically defined.

That should be it... save/reload and then open a 'tag tiddler'... the
word 'tagging' should be replaced with the current tiddler title.

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios

Eric Shulman

unread,
Feb 4, 2008, 6:14:35 PM2/4/08
to TiddlyWiki
> In a tiddler "configTweaks , tagged with systemConfig i put:
> config.macros.tagging.label="'%0'";

nice... very nice... In fact, it kind of surprised *me* that this
works... until I took a closer look at the tagging.handler() code,
which contains:

var prompt = ... this.label;
createTiddlyElement(..., prompt.format([title,tagged.length]));

Thus, you can use %0 to insert the tiddler title into the prompt, and
%1 to insert the # of tiddlers tagged with that title.

good catch!

-e



Alex Hough

unread,
Feb 5, 2008, 2:56:55 AM2/5/08
to Tiddl...@googlegroups.com
the %1 is an nice addition - thanks.

Changing the "tags:" label to "about" should be

config.macros.tags.label="about";

It doesn't work.....

Alex Hough

unread,
Feb 5, 2008, 3:37:24 AM2/5/08
to Tiddl...@googlegroups.com
config.views.wikified.tag.labelTags="about %0";

This works!

I must thank you guys for helping me get to the stage when i can do this kind of thing. 

"Give a man a fish; you have fed him for today.  Teach a man to fish; and you have fed him for a lifetime"—Author unknown

(tiddler and fish metaphor remains intact)

http://www.amatecon.com/fish.html

alex

FND

unread,
Feb 5, 2008, 3:49:29 AM2/5/08
to Tiddl...@googlegroups.com
> I must thank you guys for helping me get to the stage when i can do this
> kind of thing.

Honestly, you've surprised both Eric and myself with this very elegant
solution.
How did you come up with it in the first place? I would never have
thought of trying this...


-- F.

Alex Hough

unread,
Feb 5, 2008, 7:00:58 AM2/5/08
to Tiddl...@googlegroups.com
A while ago I asked a question how to change the default text in a tiddler that had not been formed. The Link is  here: http://tinyurl.com/ys39nb

Eric wrote:

Put the following line in a tiddler (e.g., [[ConfigTweaks]]), and tag
it with "systemConfig"... after save-and-reload, the new text will be
used.
--------------------
config.views.wikified.defaultText="You have not addressed '%0' in this
exercise yet. Please double-click and decide how you prioritise this
value";
--------------------
Note: %0 is automatically replaced with the tiddler name.

Further on in the thread he said
The easiest way to find the 'insides' is to look at the TW file
source, using a plain text editor (e.g., windows: WordPad, mac:
TextEdit), and search for the desired user-visible text that is being
displayed in the running TW document.


So
merge(config.views.wikified,{
defaultText: "The tiddler '%0' doesn't yet exist. Double-click to create it",
defaultModifier: "(missing)",
shadowModifier: "(built-in shadow tiddler)",
dateFormat: "DD MMM YYYY",
createdPrompt: "created"});
transforms to

config.views.wikified.defaultText="You have not addressed '%0' in this
exercise yet. Please double-click and decide how you prioritise this
value";

I just did the same for tagging

merge(config.macros.tagging,{
label: "tagging: ",
labelNotTag: "not tagging",
tooltip: "List of tiddlers tagged with '%0'"});
transforms to
config.macros.tagging.label="%0";

Summary:
I took the "merge" commas and curly brackets out and put in an equals sign. (I don't know much about javascript and did it so as it looked neat.

More
To change the "tags:" label
config.views.wikified.tag.labelTags="you new text here";

I am using the newHere plugin. It leads to a lot of "tagging:"  I though that a simple list under the title would be assumed to belong to the title of the tiddler.

Alex
Reply all
Reply to author
Forward
0 new messages