Javier, Sorry for not replying earlier. I have been very busy this month.
Thanks a lot for your solution! That's great! I tested your tiddler to see how it would work and I can tell tell you I'm very happy with the result. I haven't been through all the steps you suggest, but I'm sure they work perfectly. I need to finish the TOC beforehand, as long as I have access to the built-in tag picker. (Yes, I know I can get it back easily, but once the structure is done, I don't want to modify it unless it is really needed.) For the moment however, I have put that project on hold as it wasn't a priority. Anyway, thanks again for your ready-made solution. Cheers, Stéphane Le mardi 2 mars 2021 à 20:07:55 UTC+1, Javier Rojas a écrit : > On Sun, Jan 24, 2021 at 05:48:10AM -0800, Misterel85 wrote: > > So, here's what I would like: > > > > 1. I create an activity tiddler. > > 2. I create the corresponding generic source tag tiddler(s) if they > > don't already exist. Ex. a tiddler tag whose text field holds info about > a > > (hypothetical) 'dramatis.com' website would be called 'dramatis' and > tagged > > 'Source'. > > 3. For every time I add a source tag to the activity tiddler, TW checks > > whether a corresponding source detail field exists in that current > activity > > tiddler. > > 4. If not, it retrieves the name of the tag and creates a new field > > named after that tag. In the example above, a corresponding field named > > 'dramatis_detail' or simply 'dramatis' would be added in the current > > activity tiddler. > > 5. If I delete a source tag (ex. the 'dramatis' tag), the corresponding > > 'dramatis' field would also be deleted. (That step may not be necessary > if > > step 3 is implemented.) > > The following tiddler + setup should: > > * add a "Sources" field which will show up whenever you edit a > tiddler, where you will be able to search/select tags, just like the > regular tag interface; it should show up at the bottom of a tiddler > when editing it. > > * When selecting a tag *there*, it will be added to the current > tiddler, AND, a new field called "<tag> detail" will be added, if > the tag itself is tagged with the "source" tag. > > NOTE: it will only work with tiddlywiki 5.1.23 (latest release as of > today), since it depends on some new features of the "tag-picker" > macro. > > To add it to your tiddlywiki, create a new tiddler, as follows: > > title: doesn't matter, name it as you wish > tags: $:/tags/EditTemplate > content: (omit the % START % / % END % markers below) > %%%%%%%%%%%%%%%%%%%%%%%% START > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > \define acts() > <$list filter="[<tag>tag[source]]"> > <$action-setfield $tiddler="$(currentTiddler)$" $value="FILLME" $field={{{ > [<tag>addsuffix[ details]] }}} /> > </$list> > \end > > Sources: <$macrocall $name="tag-picker" actions=<<acts>> /> > %%%%%%%%%%%%%%%%%%%%%%%% END > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > If the above provides what you need, you should then consider using that > code to replace the original tags widget in the edit tiddler interface. To > do > that, I would: > > * save and backup my wiki ;) > > * copy-paste the original tiddler (its title is > $:/core/ui/EditTemplate/tags ), into this new tiddler you created. > > * integrate the "acts" macro, and the changes to the "tag-picker" > macrocall that I suggested above, to the copy-pasted tiddler content. > > * put the tiddler in the proper place in the edit interface: Click on > the tag-pill for the $:/tags/EditTemplate of the new tiddler, and > drag-and-drop the new tiddler's title to the desired position > > * Edit the $:/core/ui/EditTemplate/tags tiddler, to remove the > $:/tags/EditTemplate tag from it, so it doesn't show up in the edit > interface anymore. > > * Enjoy the new setup! > > Cheers, > > -- > Javier > -- 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/c8401bac-a186-4c78-bc89-b3f6fdeecedcn%40googlegroups.com.