I have never played with $:/streams/contextmenu/flatten
I have rather made extensive modifications to $:/plugins/sq/streams/contextmenu/contextmenu-template
This will be embarrassing for me, because I’m sure there is some more-artful way to add items to the context-menu that @saqimtiaz might enlighten us both on However, this has been my approach to adding new macro triggers to the context menu and it has worked well:
Within $:/plugins/sq/streams/contextmenu/contextmenu-template
, there is a definition for common-menu-items. These are items that you want to appear on every streams context menu, and you see that I have added several of my own, including the yadda-yadda macro for the WikiSage plugin:
\define common-menu-items()
<$macrocall $name="menu-item" title="Open" actions="""<$action-navigate/>"""/>
<$macrocall $name="menu-item" title="Rename" subtitle="((streams-rename))" actions=<<rename-node-actions>>/>
<$macrocall $name="menu-item" title="Add Description" subtitle="((add-description-actions))" actions=<<add-description-actions>>/>
<$macrocall $name="menu-item" title="Mark as Stub" subtitle="((mark-stub))" actions=<<addStubTag>>/>
<$macrocall $name="menu-item" title="Copy Title" subtitle="((copy-link))" actions="""<<copy-link>>/>"""/>
<$macrocall $name="menu-item" title="Create Reference" subtitle="((create-link))" actions="""<<add-new-link>>/>"""/>
<$macrocall $name="menu-item" title="Transclude as Note" subtitle="((transclude-config))" actions="""<<transcludeAsNote>>/>"""/>
<$macrocall $name="menu-item" title="Delete" subtitle="((streams-delete))" actions=<<delete-node-actions>>/>
<$macrocall $name="menu-item" title="Add to Daily Notes" subtitle="((transclude-tiddler))" actions=<<create-transclusion-and-append-to-daily-journal>>/>
<$macrocall $name="menu-item" title="Edit Content" subtitle="" actions="""<<clarify-content-streams>>"""/>
<$macrocall $name="menu-item" title="Yadda-yadda" subtitle="((yadda-yadda))" actions="""<<yadda-yadda-streams>>"""/>
<$macrocall $name="menu-item" title="send to calendar" subtitle="" actions="""<<.addToCalendarActions>>"""/>
\end
Now I’m absolutely sure that there is a more artful way of doing this, however, in my break-shit-fast methodology I have directly modified the $:/plugins/sq/streams/action-macros
tiddler to add all action macros that I may need:
\define mark-idea-actions()
<$action-listops $tiddler=<<currentTiddler>> $field="tags" $subfilter="Idea"/>
<$action-setfield $tiddler=<<currentTiddler>> description="{{!!text}}"/>
\end
A fun note about modifying the $:/plugins/sq/streams/contextmenu/contextmenu-template
is that you can create different context menus depeneding on different conditions. For example, I have:
<$list filter="[<currentTiddler>tag[Idea]]" variable="ideaCheck">
<$macrocall $name="menu-item" title="Create Topic" subtitle="((create-topic))" actions=<<create-topic-actions>>/>
<$macrocall $name="menu-item" title="Remove Idea Tag" subtitle="((remove-idea-tag))" actions=<<removeIdeaTag>>/>
<$macrocall $name="menu-item" title="Adopt Index" subtitle="((adopt-index))" actions=<<adopt-index-actions>>/>
<$macrocall $name="menu-item" title="Add Description" subtitle="((add-description))" actions=<<add-description-actions>>/>
<$macrocall $name="menu-item" title="Recaption" subtitle="((recaption))" actions=<<recaption-actions>>/>
<$macrocall $name="menu-item" title="Add Alias" subtitle="((add-alias))" actions=<<add-alias-actions>>/>
<$macrocall $name="menu-item" title="Upgrade to Index" subtitle="((mark-index))" actions=<<mark-index-actions>>/>
<<common-menu-items>>
</$list>
What this says is that for all tiddlers with the Tag Idea, the context menu will include Idea-tiddler-specific items in addition to the common-menu-items seen above.
I can, from the context menu, tag a thing Idea, and then open the context menu again and see Idea-specific actions