How to delete unused Tags in TW5

1,528 views
Skip to first unread message

Andy Wood

unread,
Feb 13, 2015, 7:30:31 AM2/13/15
to tiddl...@googlegroups.com
Hi,

I would like to be able to completely delete Tags that I no longer use and will now cause confusions for other users of the wiki.

For example, I initially started using a tag named 2100iX. I later decided it made more sense to use 21iX instead.

I have changed all the tiddlers that were tagged as 2100iX to 21iX.

Now, when another user creates a tiddler, they sometimes pick 2100iX instead of 21iX.

I would like to be able to delete all of the tags that are no longer required, or hide them from view perhaps?

Is it possible?

Best regards,

Andy

PMario

unread,
Feb 13, 2015, 10:39:11 AM2/13/15
to tiddl...@googlegroups.com
Hi Andy,

The tag 2100iX is only there if a tiddler with this title exists or if there is a tiddler which is still tagged 2100iX. Otherwise the tag dropdown would not show it. The 3rd possibility is, that some of your users are used to 2100iX and type it per hand. So they re-create it. ...

have fun!
mario

Tobias Beer

unread,
Feb 13, 2015, 11:34:15 AM2/13/15
to tiddl...@googlegroups.com
Hi Andy,


Best wishes, Tobias.

Jed Carty

unread,
Feb 13, 2015, 12:10:45 PM2/13/15
to tiddl...@googlegroups.com
You can do that easier now using action widgets so it only one button press http://inmysocks.tiddlyspot.com/#Search%20and%20Replace%20Tags

Tobias Beer

unread,
Feb 13, 2015, 2:46:43 PM2/13/15
to
Hi Jed,
 
http://inmysocks.tiddlyspot.com/#Search%20and%20Replace%20Tags

Nice! Seems the days of the former ways
to search and replace a tag are numbered. ;-)
Went about it slightly differently...
  • implement a select equivalent to the one in the edit template
  • added a button to eventually also rename the tag tiddler
Best wishes, Tobias.

Andy Wood

unread,
Feb 26, 2015, 4:24:59 AM2/26/15
to tiddl...@googlegroups.com

Thank you once again guys.

--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/eGvsXFm8zAk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.

JL

unread,
Sep 18, 2015, 11:43:42 PM9/18/15
to TiddlyWiki
Hi,
I've been trying to use Tobias' Replace-Tags, and getting unstable behaviour. Could be just my setup! -- but I have tested it on a vanilla 5.1.8 tw

The main issue is that after one or two uses, the replace button disappears.

Anyone else getting this? I'd like to work it out, potentially it is very useful.

I'm using version 5.1.8 on FireFox, and also TiddlyDesktop 0.0.4

Cheers, JL

Tobias Beer

unread,
Sep 19, 2015, 4:46:36 AM9/19/15
to tiddl...@googlegroups.com
Hi JL,
 
The main issue is that after one or two uses, the replace button disappears. 

That's appears to be less of an issue rather than a feature.
After all, there's nothing left to be renamed when it comes to the tag.

However, if it doesn't pop up again when you
start selecting a different tag for renaming,
then that would be a bug.

Perhaps I should indicate that to perform the change entirely,
one is to push all buttons, those checkmarks for tagged tiddlers
as well as the button to rename the tag-tiddler itself.

Best wishes,

— tb

Matabele

unread,
Sep 19, 2015, 5:57:50 AM9/19/15
to TiddlyWiki
Hi

You might find my <$mangletags> widget useful for this purpose -- it was written before the advent of action widgets, but does both the search and replace within a single widget.

It may be used like this for a search and replace (it may also be used to remove or add a tag separately) -- and several may be stacked around a button widget.

<$mangletags tiddler="Target" find="Tag to Remove" add="Tag to Replace">
<$button message="tm-mangletags">Click Me</$button>
</$mangletags>

I have attached an updated version -- the original version can be found here: http://gwiz.tiddlyspot.com

regards
$--plugins-matabele-mangletags.tid

Matabele

unread,
Sep 19, 2015, 6:11:13 AM9/19/15
to TiddlyWiki
Hi

You might also find the 'ClickAction' tool from BJ useful -- find it here: http://bjtools.tiddlyspot.com/

regards


On Saturday, 19 September 2015 10:46:36 UTC+2, Tobias Beer wrote:

Matabele

unread,
Sep 19, 2015, 6:52:45 AM9/19/15
to tiddl...@googlegroups.com
Hi

The <$mangletags> widget and the <$click> widget may be used together like this:

<$button set=<<qualify "$:/state">> setTo="replace">
Replace All
</$button>

<$list filter="[tag[Old]]">
{{!!title}}

<$mangletags find="Old" add="New">
<$button message="tm-mangletags">
<$click type="match" state=<
<qualify "$:/state">> text="replace"/>
</$button>
</$mangletags>
</$list>

regards

Matabele

unread,
Sep 19, 2015, 7:07:05 AM9/19/15
to tiddl...@googlegroups.com
Hi

I have attached a test version as a .tid file (you will need to first import both the <$mangletags> widget from gwiz and the <$click> widget from bjtools (both attached).

To delete a tag (rather than find and replace the tag) -- leave out the 'add=' attribute (or leave the 'Add' input box blank.)

Tiddlers can be instead be modified individually by clicking the buttons next to each tiddler listed.

regards

On Saturday, 19 September 2015 12:11:13 UTC+2, Matabele wrote:
$--plugins-bj-click.tid
$--plugins-matabele-mangletags.tid
Tabular Find and Replace All.tid

JL

unread,
Sep 20, 2015, 11:16:59 PM9/20/15
to TiddlyWiki
Hi Tobias,

What confused me is that most of my tags are also tiddlers. So when I entered a tag, I saw the button offering to rename the tiddler (not replace the tag). That was the button I was referring to in my earlier post.
It took me a while to work out what was going on there, and also to realise that what looks like checkboxes next to the matching tiddlers is actually the button that replaces the tag. I just assumed it was a checkbox to choose which tiddlers would have the tag replaced.
So I was merrily renaming tiddlers without replacing the tags. I didn't twig till I read the last paragraph in your post. All sorted now, thanks for the plugin. I think I'm becoming your numbskull UI tester.
Cheers JL

JL

unread,
Sep 20, 2015, 11:18:51 PM9/20/15
to TiddlyWiki
Hi Matabele,
Thanks for that. I have got my head around Tobias' plugin interface now, but will give yours a shot too, in the interests of my tw education.
Cheers JL

Hegart Dmishiv

unread,
Sep 20, 2015, 11:35:50 PM9/20/15
to TiddlyWiki
One thing I learned recently about TiddlyWiki, which might be relevant, is that if you apply a personalised colour to a tag using $:/TagManager, a tiddler is generated automatically for that tag if there isn't already one, with nothing else in the new tiddler but the color field (and, or course, the title). Don't know if that helps at all.

Matabele

unread,
Sep 21, 2015, 1:04:27 AM9/21/15
to TiddlyWiki
Hi JL

The functionality of the two methods is equivalent with the exception that I have offered an option to replace/remove the selected tag from all tiddlers with one button click (click the four crosses at the top of the RHS column.)

I thought this might be useful for your particular use case (you mentioned wanting to change all of the 2100iX tags to 21iX) -- with my utility, this can be done with a single button click:
-- select the 2100iX tag with the select box (the tag to be removed)
-- type 21iX into the input box (the tag to replace)
-- click the button with the four crosses

regards

Tobias Beer

unread,
Sep 21, 2015, 9:00:55 AM9/21/15
to tiddl...@googlegroups.com
Hi JL,
 
So I was merrily renaming tiddlers without replacing the tags. 
I didn't twig till I read the last paragraph in your post. 

:D
 
All sorted now, thanks for the plugin.

Solutions keep improving and so I will surely be checking Metabele's
reference more closely and soonish write a little test on that too.

What I'm not too keen on in tb5
are dependencies to third party plugins atm.

@Metabele,
Don't we already have the ability yet to use lists with action widgets?

Best wishes,

— tb

Evolena

unread,
Sep 21, 2015, 9:28:05 AM9/21/15
to TiddlyWiki
Le lundi 21 septembre 2015 15:00:55 UTC+2, Tobias Beer a écrit :
@Metabele,
Don't we already have the ability yet to use lists with action widgets?


Yes, it's now possible (and very useful!).
In TW5.1.10, there will also be a tm-rename-tiddler message, which allow to rename a tiddler (scoop!), along with the update of tags and lists.

Tobias Beer

unread,
Sep 21, 2015, 9:36:11 AM9/21/15
to tiddl...@googlegroups.com
Hi Evolena,
 
Yes, it's now possible (and very useful!).
In TW5.1.10, there will also be a tm-rename-tiddler message, which allow to rename a tiddler (scoop!), along with the update of tags and lists.

Ok, so 5.1.10 it is. Thanks for the pointers.
Haven't seen it on the prerelease-notes yet.


Hoping it will show up until then.

Best wishes,

— tb

Matabele

unread,
Sep 21, 2015, 10:17:58 AM9/21/15
to TiddlyWiki
Hi

It is possible to use $action-widgets within lists (in this case a pair of tm-add-tag and tm-remove-tag) would do the trick -- but, the messages are unconditional and must be used within a list with the filter selecting only those tiddlers containing the tag to remove. 

I can't remember my usage case, but I needed a widget that would conditionally add a new tag iff the tiddler contained the tag to remove. This allows the list widget filter to select a listing other than [tag[tag-to-remove]] -- hence the $mangletags widget (not necessary in this use case.)

In addition, the use of bj's $click widget allows that all substitutions can be actioned with a single button click -- removing the necessity of having to individually click buttons down the list (although this functionality is retained.) I find this behaviour convenient (although potentially risky) for many use cases.

regards

Andy Wood

unread,
Sep 21, 2015, 10:19:37 AM9/21/15
to tiddl...@googlegroups.com
Hi guys,
I seem to be getting updates to this particular topic as soon as they are posted. All others come through daily as a digest / abridged at around 06:20 GMT
I wonder if a group admin could check why I am getting these please?

Best wishes,

Andy

On 21 September 2015 14:36:10 GMT+01:00, Tobias Beer <beert...@gmail.com> wrote:
Hi Evolena,
 
Yes, it's now possible (and very useful!).
In TW5.1.10, there will also be a tm-rename-tiddler message, which allow to rename a tiddler (scoop!), along with the update of tags and lists.

Ok, so 5.1.10 it is. Thanks for the pointers.

Best wishes,

— tb


--
Sent from my Android device with K-9 Mail. Please excuse any brevity and typos.

Matabele

unread,
Sep 21, 2015, 10:46:13 AM9/21/15
to TiddlyWiki
Hi

Looking back at my efforts from the era of TW5-beta, it appears that my main motivation for employing stacked widgets was to create a number of tiddlers in the background (in this case, folders for a GTD type wiki -- I needed to create a number of custom tiddlers with different field values.)

The problem that arises is that the title of the new tiddler isn't known until the tiddler is created. Try creating a number of tiddlers with repeated clicks of a button -- they will be named 'New Tiddler', 'New Tiddler 1', New Tiddler 2' .... (same goes for any other base title specified.)

In order to manipulate the fields of the newly crated tiddlers, it was necessary for other widgets to know the title of the newly created tiddlers. This I solved by passing the name of the new tiddler through the widget stack using the 'param' attribute of the widget message. This precluded the use of tm-add-tag and tm-remove-tag widget messages, as the 'param' attribute is used in this case to carry the name of the tag.

The widget is also less confusing to use due to the brevity of the code (the same widget may be used to unconditionally add or remove a tag, or to conditionally replace a tag.)

I have now constructed an $action-mangletags widget which may be more convenient for many usage cases.

regards

Matabele

unread,
Sep 21, 2015, 10:48:33 AM9/21/15
to TiddlyWiki
Hi Andy

By contributing to this thread, you have automatically subscribed to updates from this thread. There is an option to change this behaviour.

regards

Andy Wood

unread,
Sep 21, 2015, 11:05:08 AM9/21/15
to tiddl...@googlegroups.com
Thank you for the tip. I guess this is a thread from a while ago, perhaps one of the 1st posts I made.

Best wishes,

Andy

Tobias Beer

unread,
Sep 21, 2015, 1:40:11 PM9/21/15
to TiddlyWiki
Hi Metabele,
 
In addition, the use of bj's $click widget allows that all substitutions can be actioned with a single button click -- removing the necessity of having to individually click buttons down the list (although this functionality is retained.)

Wouldn't nesting action widgets inside a list inside a button achieve the same?

Best wishes,

— tb

Matabele

unread,
Sep 21, 2015, 3:26:40 PM9/21/15
to tiddl...@googlegroups.com
Hi

A quick test using the action-widget version of the $mangletags widget would indicate that this achieves the same thing. I'm not sure how to set this up so that tiddlers can be individually modified or all modified at once -- I suppose two separate listings are required -- one to action the whole list ($list nested inside the $button), and another to list each with a matching button ($buttons nested inside the $list.) 

I'll have to do further tests.

regards

Matabele

unread,
Sep 21, 2015, 3:45:48 PM9/21/15
to TiddlyWiki
Hi

Yep -- that seems to do the trick. 

regards

On Monday, 21 September 2015 19:40:11 UTC+2, Tobias Beer wrote:
Test Action.tid

Tobias Beer

unread,
Sep 22, 2015, 3:54:23 AM9/22/15
to TiddlyWiki
Hi Metabele / @Jeremy,

I would have hoped that with the messages we won't need $mangletags anymore, but I guess putting the fieldmangler inside a button won't work...

Find Tag:
<span title="Select a Tag to Find">
<$select tiddler="$:/temp/find" field="text" default='(none)'>
<option value="null">(none)</option>
<$list filter="[all[tiddlers]tags[]sort[title]]">
<option value=<<currentTiddler>>><$view field="title"/></option>
</$list>
</
$select>
</span>

Replace With: <$edit-text tiddler="$:/
temp/add"  tag="input" type="text" placeholder="Add Me" />

<$button>
<$list filter="
[tag{$:/temp/find}]">
<$fieldmangler tiddler=<<currentTiddler>>>
<$action-sendmessage message="
tm-add-tag" param={{$:/temp/add}}/>
<$action-sendmessage message="
tm-remove-tag" param={{$:/temp/add}}/>
</$fieldmangler>
</$list>
<$action-setfield $tiddler={{$:/temp/find}} title={{$:/temp/add}}/>
<$action-deletetiddler $tiddler={{$:/temp/find}}/>
<$action-sendmessage $message="
tm-close-tiddler" $param={{$:/temp/find}}/>
replace
</$button>


|!search 
<$link to={{$:/temp/find}}><$view tiddler={{$:/temp/find}} field="title"/></$link>|!replace <$link to={{$:/temp/add}}><$view tiddler={{$:/temp/add}} field="title"/></$link>|
|<<list-links [tag{$:/temp/find}]>>|<<list-links [tag{$:/temp/add}]>>|

What makes the fieldmangler necessary anyway?

Best wishes,

— tb

Matabele

unread,
Sep 22, 2015, 4:57:22 AM9/22/15
to tiddl...@googlegroups.com
Hi Tobias

The $fieldmangler widget was introduced early on in the development of TW5 -- at the time (I presume) it was the only way of manipulating tags and fields -- it performs an essential function in the core functionality of TW5.

I developed the $mangletags and $setfield widgets as more versatile replacements for the $fieldmangler widget. The new $action-setfield has in turn rendered much of the functionality of my $setfield widget redundant.

I would prefer a more versatile replacement for the $fieldmangler widget, but this would necessitate numerous changes to the code in the core. Perhaps, in the interim, it would be easier to include a widget in the core along the lines of my new $action-mangletags widget. I will publish soon, but I wish to first test this out in usage, as I made several changes to the $mangletags code (my $mangletags widget contained a logic error for several iterations after I first published.)

I have attached a beta version for testing purposes.

regards
action-mangletags.tid
Message has been deleted

Tobias Beer

unread,
Sep 22, 2015, 5:49:50 AM9/22/15
to TiddlyWiki
Hi Metabele,

Did some simplifying and ...maybe rewording, e.g. "find" is really "remove", etc.
Diff and use as you see fit.

Best wishes,

— tb
action-mangletags.tid

Matabele

unread,
Sep 22, 2015, 6:18:26 AM9/22/15
to TiddlyWiki
Hi Tobias

Haven't tested as yet, but a quick look at the code leads me to believe that the tags would be removed and added unconditionally. My widget is supposed to conditionally add a tag only iff the first tag is found (in the case that both find= and add= are specified) and unconditionally add or remove the tags if only one of the attributes is specified.

regards

Matabele

unread,
Sep 22, 2015, 7:37:51 AM9/22/15
to TiddlyWiki
Hi

I have adopted your code improvements, but have corrected the logic -- this version appears to work as intended.

regards

On Tuesday, 22 September 2015 11:49:50 UTC+2, Tobias Beer wrote:
$--core-modules-widgets-action-mangletags.tid

Matabele

unread,
Sep 22, 2015, 8:10:14 AM9/22/15
to tiddl...@googlegroups.com
Hi Tobias

Nope -- the logic still adds a tag unconditionally sometimes. I had this same problem with the logic with my $mangletags widget -- any ideas?

I think this might be due to left-over values stored in state tiddlers rather than an error in the widget logic. The widget seems to behave as intended (as it does with the attached test tiddler), then in some usage cases it adds the tag unconditionally. 

Without this functionality, the widget must be placed within a filter which chooses only those tiddlers containing the tag to remove -- I needed to use the widget within another filter -- as in: search all tiddlers with a value of 'one' in field1 and, iff the tiddler has the tag 'old', remove it and replace it with tag 'new' (else do nothing.)

With the widget as is, all of the tiddlers with a value of 'one' in field1 will have tag 'new' added regardless of whether they were tagged 'old'.

This can be remedied by correcting the filter i.e. list all tiddlers with both the value 'one' in field1 and the tag 'old' -- but I believe the added functionality is justified in the interests of simpler coding. 

I have attached my test tiddler -- clicking either the second or third button should have no effect unless the tiddler is tagged with either 'old' or 'new'.

regards

On Tuesday, 22 September 2015 11:49:50 UTC+2, Tobias Beer wrote:
Test Mangletags.tid

Tobias Beer

unread,
Sep 22, 2015, 12:04:23 PM9/22/15
to TiddlyWiki
Hi Metabele,
 
My widget is supposed to conditionally add a tag only iff the first tag is found (in the case that both find= and add= are specified) and unconditionally add or remove the tags if only one of the attributes is specified.

Ah, it looked like you're always adding the tag, when defined.
Tbh, I was looking at your code, didn't look at any documentation.
So, yes, before hand you only added the tag when...
  • a tag to be removed was successfully removed
  • no tag was to be removed but just another one added
Not exactly sure why you'd bind adding a tag to "only when the other was removed". Why is that? Anyhow, you're right, the way I modified it I did not pay close enough attention to that tiny detail. :-)

Best wishes,

— tb

Matabele

unread,
Sep 22, 2015, 9:19:38 PM9/22/15
to TiddlyWiki
Hi Tobias

As I mentioned, there are other ways of achieving a true 'find & replace' (i.e placing the widget within a list which includes only tiddlers containing the tag to remove), however:
-- this is not what a user would expect from a true 'find & replace' function (it would be rather, a 'replace anyway' function)
-- this (therefore) renders coding simpler in many usage cases, as you don't have to construct a suitable filter

For example, the widget can be used like this:

<$button>
<$list>
<$action-mangletags remove="old-tag" add="new-tag"/>
</$list>
</$button>

-- or like this:

<$button>
<$action-mangletags tiddler="My Target" remove="old-tag" add="new-tag"/>
</$button>

-- and the results are exactly as expected (find and replace.)

regards

Tobias Beer

unread,
Sep 23, 2015, 1:46:34 AM9/23/15
to TiddlyWiki
Hi Metabele,
 
-- and the results are exactly as expected (find and replace.)

I see now, it really is (or started out) as find and replace. And so, you didn't expect the target to be properly fitlered first (to only apply to tiddlers where a given tag was found). You only wanted to add (/replace) when you found (a given tag) through your widget first ...and then later, you also used it as a way to always just add at tag when, nothing to "find" was specified.

Mhhh, I do wonder though, when you used mangletags inside a button, what good would be showing that button if it would not do anything in the end? ...in the case that a tiddler did not have that tag that you wanted to replace with another one.

This terminology is what was a little confusing, to me, about your widget. When it comes to tagging, I know adding and removing ...and so a more complex "replace only when found" would have been the exceptional case that might have benefited from a dedicated flag / parameter to be triggered. But for you, it was the basic paradigm based on which the widget was built, and the rest is history. ^_^

Best wishes,

— tb
Reply all
Reply to author
Forward
0 new messages