Hum so from what I understand to make such a thing works it would require to somehow modify the way tiddlywiki navigate to an url and use a linkcatcher to be able to trigger an action widget..
When TiddlyWiki starts up it processes permalinks according to the following steps; the same steps are repeated if the permalink changes dynamically (this happens in response to the user editing the address bar, for example).
If the permalink contains a colon, treat the string before as the target and the string after it as the story filter
If the permalink doesn’t contain a colon, treat the entire string as the target and mark the story filter as unspecified
If the story filter was unspecified and we’re in the process of starting up, then set the story filter to the empty string if the target is specified, or to the default tiddlers if the target is unspecified
If the story filter was unspecified and we’re not starting up, then set the story filter to the current story list
Evaluate the story filter as the story list
If the target is specified and not present in the story list then add it at the top
If the target is specified then navigate to it, otherwise navigate to the first tiddler in the story list
So it seems like this is the story filter that needs to be tweaked ?
I guess this would be done in $:/core/ui/PageTemplate..
@TW_Tones Yes sorry about that, I will reformulate :
If we add a colon in the url of a wiki, navigating to that url make tiddlywiki treat the string after it as the story filter.
We can define an ActionWidgets in a macro, and provided it is used in a triggering widget, the action widget will be executed.
TW 5.2.0 now support literal macro parameters.
My question then is : is it possible to catch and trigger the action widget generated by a macro in the story filter ?
@TiddlyTitch yes that’s what I meant ! That way we could use bookmarks to interact with a wiki - a bit like what the safe mode does but with far more possibilities.
This is because we weren’t promised that "something <<macro>> something" would work everywhere – but only inside wikitext macro parameters.
Finally, if you just want a link that opens it’s target for editing, you can use a button disguised as a link using classes tc-btn-invisible tc-tiddlylink:
@telumire I am sorry, but I still don’t understand the outcome or purpose it. My Bad I am sure, and you don’t need to keep explaining to me, others seem to be answering your question.
I have used in depth the following methods
Respond to content on the URL in the start up actions
** permitting a trigger in a wiki to reload the same with a message in the URL an respond to the message.
Make use of the clicking of links to trigger other actions
In this case also you are talking about URL’s which are in fact places inside the current wiki so the need to treat them as external urls is curious. Although I have done this for a Check in and Out Mechaisium, on reloading in “edit” mode I immediately save the wiki with details it is checked out for “edit”.
@Mark_S The href was to demonstrate the filter-in-url feature that we can use in tiddlywiki. The <<now>> macro seems to work everywhere (even in the url !) so I tough that maybe something could be done .. looks like I was wrong! The button idea is great (I use it a lot), but the benefit of an “in-url startup action” is that we could share it to other and bookmark it.
@TW_Tones I was talking about URL placed inside the current wiki because tiddlywiki can navigate to the specified filter inside the url without reloading the whole wiki, so I thought that an external url would work the same as an internal url.
The specific use case I had in mind is to have a special link that open the wiki in “edit mode”, that we can then share to other or bookmark for ease of access.
I didnt know we could do that, looks like this could be a nice alternative. This would require to reload the whole wiki but it’s fine for the purpose of “starting the wiki with a specific setting”. For “in-wiki” action I could use the solutions mentioned by @Mark_S.
Do you have examples I could take inspiration from ? Are you using a list or reveal widget + a regex to check if a specific string is in the url ?
I have a tiddler tagged $:/tags/StartupAction/PostRender that interrogates the contents of [prefix[$:/info/]] and or tiddlers in Local storage but not saved to the wiki. All Actions that are inside listWidgets are executed in the tiddler if the conditions are correct.
I disable save to host unless the wiki is available for checkout,
On receiving a request update the wiki and save immediately to ensure another visitor arrives they see its checked out.
When in read only mode a request to edit is sent from a button for example;
The above sets a tiddler only saved in local storage and refreshes. The wiki startup then interrogates the $:/local/cio-message tiddler if it sees a request and the just loaded wiki is not already in edit mode triggers all the edit mode settings and saves.
You could use Erics cookies plugins rather than local storage however if using file:// addresses you can tell between sessions.
This is quite sophisticated and complex and so far I have being working on my own, I have the proof of concept just need to polish some solutions.