Toolbar - custom button opening dropdown menu

even more important: how do I pass to the tiddler that implements a list item the context (or status) of the calling tiddler?
Say that I have a tiddler ‘My Cookbook’, which somehow displays in a fancy, oredered fashion a collection of all recipes whose tiddler is tagged -you guessed it- ‘My Cookbook’, and I want to add to the cookbook a new recipe for pasta with pesto sauce. I can possibly fill in some info -like, say, ‘pesto sauce’ somewhere in a text field of ‘My Cookbook’ tiddler and then click the button and choose ‘new pasta recipe’, so the new_pasta_recipe tiddler -tagged $:/tags/more-ViewToolbar- implementing ‘new pasta recipe’ by means of an <$action-createtiddler> widget can create a new tiddler ‘My wonderful pasta al pesto recipe #1’ for me to fill in with the actual recipe. How do I pass to new_pasta_recipe tiddler the current ‘My Cookbook’ context, so I can have My wonderful pasta al pesto recipe #1’s tags be set to ‘My Cookbook’, ‘pesto sauce’ and whatever useful info is to find in ‘My Cookbook’ 's current status (or context)? Of course I could just hard-code ‘My Cookbook’ string somewhere inside new_pasta_recipe, for the latter to use it as a tag of the new recipe tiddler it creates, but this would make code less reusable when I need to call the same new_pasta_recipe choice from whithin ‘My NEW Cookbook #2’…
Hope I made myself understandable with this example -just an example by the way, I have no cookbook tiddler whatsoever and I know very well how to prepare pasta with pesto sauce without needing to read any recipe.

I am sure other can help but as I am busy this morning some quick tips; Tiddlywiki is ideal for what you propose and I may help later.

To make a button or any content “conditional” wrap it in a list or reveal widget. Eg before and after all content in your button

<$list filter="condition" variable=nul>
   button or other content here
</$list>

The filter may be [all[current]tag[tagname]] or '[all[current]has:field[fieldname]`etc…

The first thing when organising with tiddlywiki is to try is using the new here button which creates a tiddler tagged with the current tiddler.

Once a tag exists its easy to add it to other tiddlers.

done, I wrapped the button in your $:/PSaT/buttons/more-tiddler-actions code and it works.

Thanks

1 Like

solved! It turned out that inside every tiddler implementing a single item of the dropdown list (ie any tiddler tagged $:/tags/more-ViewToolbar ), the current tiddler is indeed the ‘calling’ tiddler (the one from which we open the dropdown and select our choice), so its context is there at hand as the context of the current tiddler.
Anyway I don’t know if it is safe to rely on this finding, or if there is a better way to access ‘calling’ tiddler’s context.

Thanks anyway,
CG