Re: [tw5] Re: Change tag name
On Saturday, June 6, 2020 at 9:02:18 PM UTC-7, Eric Shulman wrote: I've made a small change to my previous "change tag" code: when you press the "change" button, instead of simply clearing the current select list value, it now sets the select list value to the new tag value and clears the "new" tag input. This makes it easy to change the same tagged tiddlers again (e.g., in case you made a typo or changed your mind) The code differences are shown below using red text: > <$select tiddler="$:/temp/changetag/old" default=""> >select an existing tag... ><$list > filter="[tags[]sort[]]"><> > > <$edit-text tag="input" tiddler="$:/temp/changetag/new" default="" > placeholder="enter a new tag..." /> > <$button> change ><$list filter="[tag{$:/temp/changetag/old}]"> > <$action-listops $tiddler=<> $field="tags" > $subfilter="-[{$:/temp/changetag/old}] [{$:/temp/changetag/new}]" /> > > * <$action-setfield $tiddler="$:/temp/changetag/old" > text={{$:/temp/changetag/new}} />* > * <$action-deletetiddler $tiddler="$:/temp/changetag/new" />* > > <$button> reset ><$action-deletetiddler $filter="[prefix[$:/temp/changetag]]" /> > > Change these tiddlers: > <$list filter="[tag{$:/temp/changetag/old}]"> <$link/> > enjoy, -e -- 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 tiddlywiki+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/178875d1-759b-4789-bb5f-5b4eb132e7f2o%40googlegroups.com.
Re: [tw5] Re: Change tag name
Eric: Very nice! This now replaces my use of Alberto's code that I've been using happily since 2014. I really like the way you've structured these new utilities. They are very easy to understand and use as a base for other personalized utility functions. -- 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 tiddlywiki+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/0c16e857-e882-4979-aebd-b8e0d18e27deo%40googlegroups.com.
Re: [tw5] Re: Change tag name
Eric, This is nice an elegant. I tested it on Tiddlywiki.com and realised perhaps an option to also rename the tag tiddler as well, eg HelloThere Thus the tiddlers so tagged rejoin there parent? Otherwise my solution of renaming an existing tag tiddler is safer? Regards Tony On Sunday, June 7, 2020 at 2:02:18 PM UTC+10, Eric Shulman wrote: > > On Saturday, June 6, 2020 at 3:38:47 PM UTC-7, springer wrote: >> >> For future readers of this thread, there's also Alberto Molina's special >> solution, here: >> https://groups.google.com/forum/#!topic/tiddlywiki/OCntQ79DuwM >> which doesn't require creating a tiddler for the tag, and also is much >> lighter-weight than the very powerful TW-Commander. >> > > Here's another solution: > <$select tiddler="$:/temp/changetag/old" default=""> >select an existing tag... ><$list > filter="[tags[]sort[]]"><> > > <$edit-text tag="input" tiddler="$:/temp/changetag/new" default="" > placeholder="enter a new tag..." /> > <$button> change ><$list filter="[tag{$:/temp/changetag/old}]"> > <$action-listops $tiddler=<> $field="tags" > $subfilter="-[{$:/temp/changetag/old}] [{$:/temp/changetag/new}]" /> > ><$action-deletetiddler $tiddler="$:/temp/changetag/old" /> > > <$button> reset ><$action-deletetiddler $filter="[prefix[$:/temp/changetag]]" /> > > Change these tiddlers: > <$list filter="[tag{$:/temp/changetag/old}]"> <$link/> > > Notes: > * The $select gives you a droplist of all current tags in the document > (plus a prompt text at the top of the droplist) > * The selected tag is stored in $:/temp/changetag/old > * The $edit-text lets you input a new tag name into $:/temp/changetag/new > * The change $button loops over all tiddler matching the old tag and uses > $action-listops to remove the old tag and add the new tag > * The change $button also resets the selection in the list of tags (since > the selected tag no longer exists in the document) > * The reset $button clears both temp inputs > * The $list that appear below the form controls shows you which tiddlers > will be re-tagged > > enjoy, > -e > > > -- 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 tiddlywiki+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/6084a1d3-04fe-4415-b038-3119ff396ea8o%40googlegroups.com.
Re: [tw5] Re: Change tag name
On Saturday, June 6, 2020 at 3:38:47 PM UTC-7, springer wrote: > > For future readers of this thread, there's also Alberto Molina's special > solution, here: > https://groups.google.com/forum/#!topic/tiddlywiki/OCntQ79DuwM > which doesn't require creating a tiddler for the tag, and also is much > lighter-weight than the very powerful TW-Commander. > Here's another solution: <$select tiddler="$:/temp/changetag/old" default=""> select an existing tag... <$list filter="[tags[]sort[]]"><> <$edit-text tag="input" tiddler="$:/temp/changetag/new" default="" placeholder="enter a new tag..." /> <$button> change <$list filter="[tag{$:/temp/changetag/old}]"> <$action-listops $tiddler=<> $field="tags" $subfilter="-[{$:/temp/changetag/old}] [{$:/temp/changetag/new}]" /> <$action-deletetiddler $tiddler="$:/temp/changetag/old" /> <$button> reset <$action-deletetiddler $filter="[prefix[$:/temp/changetag]]" /> Change these tiddlers: <$list filter="[tag{$:/temp/changetag/old}]"> <$link/> Notes: * The $select gives you a droplist of all current tags in the document (plus a prompt text at the top of the droplist) * The selected tag is stored in $:/temp/changetag/old * The $edit-text lets you input a new tag name into $:/temp/changetag/new * The change $button loops over all tiddler matching the old tag and uses $action-listops to remove the old tag and add the new tag * The change $button also resets the selection in the list of tags (since the selected tag no longer exists in the document) * The reset $button clears both temp inputs * The $list that appear below the form controls shows you which tiddlers will be re-tagged enjoy, -e -- 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 tiddlywiki+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/db618030-655c-4613-b461-490e89315978o%40googlegroups.com.
Re: [tw5] Re: Change tag name
For future readers of this thread, there's also Alberto Molina's special solution, here: https://groups.google.com/forum/#!topic/tiddlywiki/OCntQ79DuwM which doesn't require creating a tiddler for the tag, and also is much lighter-weight than the very powerful TW-Commander. -Springer On Saturday, June 6, 2020 at 1:24:46 PM UTC-4, Gideon Dresdner wrote: > > I wound up using TonyM's solution, > > Using the tag pill on a tiddler, >> >> Or <> click the first line the tags name, this >> goes to the tags tiddler (if it was one) or allow you to edit it so it >> becomes a tiddler as well as a tag. >> >> Save it >> >> Rename the tags actual tiddler and it will update wherever the tag is >> used. *Check ** Update test to Testit in the tags and list fields of >> other tiddlers* to be sure. >> > > I tried something similar before I posted to the group, but somehow it > wasn't intuitive to me that I had to save and then update. Anyway, works > like a charm. > > Thanks a lot! > Gideon. > -- 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 tiddlywiki+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/c8334646-84c5-4142-be70-afe2ba31d113o%40googlegroups.com.
Re: [tw5] Re: Change tag name
I wound up using TonyM's solution, Using the tag pill on a tiddler, > > Or <> click the first line the tags name, this > goes to the tags tiddler (if it was one) or allow you to edit it so it > becomes a tiddler as well as a tag. > > Save it > > Rename the tags actual tiddler and it will update wherever the tag is > used. *Check ** Update test to Testit in the tags and list fields of > other tiddlers* to be sure. > I tried something similar before I posted to the group, but somehow it wasn't intuitive to me that I had to save and then update. Anyway, works like a charm. Thanks a lot! Gideon. -- 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 tiddlywiki+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/CAPGvaSO8g7QThNi5gT_A2EoQxup-ndWMtX2HW2%2BvE03tStUhLw%40mail.gmail.com.