Issue with action-navigate

142 views
Skip to first unread message

Mohammad

unread,
Jul 28, 2018, 12:27:39 AM7/28/18
to TiddlyWiki
The action navigate used like below

<$action-navigate $to="target" />

If a text reference used for target tiddler, then if you have space in the target tiddler name, it fails

Assume

<$action-navigate $to=<<target>> />

Where target is a macro or variable with this value

Hi I am a Tiddler

How resolve this?

Other example can be like this

<$action-navigate $to={{MyTiddler!!SomeRef}} />


Mohammad

Mohammad

unread,
Jul 28, 2018, 12:44:35 AM7/28/18
to TiddlyWiki
An Update

I used the below macro to return to last viewed tiddler when switch back to Classic Story View, but no success!


\define gotoSlide()
<$set name="target" value={{$:/HistoryList!!current-tiddler}}>
<$action-navigate $to=<<target>>/>
</$set>
\end


TonyM

unread,
Jul 28, 2018, 8:31:13 AM7/28/18
to TiddlyWiki
Mohammad,

Action widgets need a trigger to action them. Buttons are the most common. Where is the trigger in this case?

Tony

Mohammad

unread,
Jul 28, 2018, 9:11:37 AM7/28/18
to TiddlyWiki
Yes, It was inside a button!
But when you have target title with spaces, it gets confused!

Mohammad

TonyM

unread,
Jul 28, 2018, 8:03:54 PM7/28/18
to TiddlyWiki
Mohammad,

If you think about it the following does not delimit the value correctly when there is a space

value={{$:/HistoryList!!current-tiddler}}

I think putting quotes around this may not work.

Wikify will work text="{{$:/HistoryList!!current-tiddler}}"

Then put in the wikified variable
Value=<<wikifyvar>>

Regards
Tony

Mohammad

unread,
Jul 28, 2018, 10:23:26 PM7/28/18
to TiddlyWiki
Thanks Tony, let's try it.

Mark S.

unread,
Jul 28, 2018, 11:39:44 PM7/28/18
to TiddlyWiki
When I try this:

\define target() My Little Tiddler

<$button>Go forth
<$action-navigate $to=<<target>> />
</
$button>

It works. That is, it navigates to the tiddler "My Little Tiddler" even though that tiddler has spaces in it's name. Perhaps we need to know more about how you are making "target" ?

Good luck!
-- Mark

Mohammad

unread,
Jul 29, 2018, 4:06:28 PM7/29/18
to TiddlyWiki
Mark!
 Thank you! I used the same! I read the $:/HistoryList!!current-tiddler when I switch between two story viewes (zoomin and classic).
By the way what you proposed also worked for me!

Still I could not figure it out how to focus on the same tiddler when I change story view!


Mohammad

Mark S.

unread,
Jul 29, 2018, 4:19:52 PM7/29/18
to TiddlyWiki
How are you changing the story view? Through the control panel, or some other way?

-- Mark

Mohammad

unread,
Jul 29, 2018, 4:28:34 PM7/29/18
to TiddlyWiki
Mark!
 I use a macro! I click on a button to go full screen and zoomin view! something like this
<$action-sendmessage $message="tm-full-screen"/>

<$action-setfield $tiddler="$:/view" text="zoomin"/>




In the macro I store, the current story view in a state tiddler
When I switch back, I read the state tiddler and overwrite the  $:/view something like this

  <$action-sendmessage $message="tm-full-screen"/>
  <$set name="previous-story-view" value={{$:/state/tiddlyshow/presentation!!story-view}} >
    <$action-setfield $tiddler="$:/view" text=<<previous-story-view>> />
  </$set>


Mark S.

unread,
Jul 29, 2018, 7:25:53 PM7/29/18
to TiddlyWiki
When I zoomin like this:

<$button>Zoom in
<$set name=vlastviewed tiddler={{$:/HistoryList!!current-tiddler}}  field="text">

<$action-setfield $tiddler="$:/view" text="zoomin"/>
</$set>
</$button>

It always goes to the last spot in the history list. Is that not what you expect/want ?

-- Mark

Mohammad

unread,
Jul 29, 2018, 11:10:58 PM7/29/18
to TiddlyWiki
Mark, check the reverse!
When you go back to classic view from zoomin view , it does not work!

Let me know your solution!


Mohammad

Mark S.

unread,
Jul 31, 2018, 1:16:24 AM7/31/18
to TiddlyWiki
Hi Mohammad,

It appears to me that the effects of changing the view occur after the button has run, so any navigation is no longer in effect. It might be possible to re-order the StoryList, so that the tiddler you want to navigate to is at the top of the list. Since the restore puts the user at the top of the page (or leaves the user there), that is *almost* the same thing as navigating to the item.

-- Mark

Mohammad

unread,
Aug 1, 2018, 1:58:30 AM8/1/18
to tiddl...@googlegroups.com
Mark,
Thank you for your hint. I solved it this way

\define newList() [[$(v1)$]] $(v2)$

<$button>Change List
  <$set name="v1" value={{$:/
HistoryList!!current-tiddler}}>
   
<$set name="v2" filter=" [list[$:/StoryList]]">
     
<$action-setfield $tiddler="$:/StoryList" list=<<newList>> />
    </
$set>
 
</$set>
</
$button>


This works now, but I am not sure if this is the correct method!
Reply all
Reply to author
Forward
0 new messages