[TW5] Search and Replace Tags?

90 views
Skip to first unread message

D John

unread,
Aug 27, 2015, 12:09:17 AM8/27/15
to tiddl...@googlegroups.com
The post is part question, part wish.

The other day was looking for a way to rename tags and found a solution by Tobias beer.

Today I found one much easier to decipher by Albert Molina

Wished developers would add such solutions to the documentation to make them easier for newer users to find and give credit to contributors.
Wouldn't the TiddlyWiki documentation get better ?
Besides, Adding it to the documentation would help prove the point, there is indeed Unity in the diverse tidily Universe!

The question is, Is Tobi beer's solution better than Albert Molina's in terms of speed, security and what not ?
If both works, what is the advantage of one over the other?

--
Rainbow
സാറ് പുഞ്ചിരിക്കുന്നു 

Jed Carty

unread,
Aug 27, 2015, 4:24:50 AM8/27/15
to TiddlyWiki
The one by Tobias is an updated version of the second one made after some features were added that let you add the new tag and remove the old tag from a list of tiddlers with a single action. Most of the complexity comes from making it look nice and making it so that the language can be changed.
The benefit is that you only have to click one button for all of them.

The part that does the work is equivalent to a tiddler with this content:

Tag to replace: <$edit-text tiddler='$:/temp/FindAndReplaceTags' field='find' placeholder='Tag to replace'/>

New tag: <$edit-text tiddler='$:/temp/FindAndReplaceTags' field='replace' placeholder='New tag'/>

<$button>Find and Replace Tags
<$list filter='[tag{$:/temp/FindAndReplaceTags!!find}]'>
<$fieldmangler>
<$action-sendmessage $message='tm-remove-tag' $param={{$:/temp/FindAndReplaceTags!!find}}/>
<$action-sendmessage $message='tm-add-tag' $param={{$:/temp/FindAndReplaceTags!!replace}}/>
</$fieldmangler>
</
$list>
</$button>

Tiddlers affected:

<$list filter='[tag{$:/temp/FindAndReplaceTags!!find}]'/
>


which is hopefully a bit easier to understand.

Or if you want something much more complex for some reason you could use this. But that is far more complex than you probably need. I also need to finish that at some point.

Reply all
Reply to author
Forward
0 new messages