Skip to content

How to navigate to a tiddler in default layout from a custom layout (when out of default layout widget tree) #8123

Closed Answered by linonetwo
linonetwo asked this question in Q&A
Discussion options

You must be logged in to vote

This works in calendar layout. Don't know why but button's to works...

  <$button to=<<currentTiddler>> style="flex: 4;" class="tw-calendar-layout-event-preview-close-button">
    <<lingo Button/OpenInStory/Caption>> {{$:/plugins/linonetwo/tw-calendar/Images/ExitLayout}}
    <$action-setfield $tiddler="$:/layout" text="" />
  </$button>

Or do this in js, this works

$tw.wiki.setText('$:/layout', 'text', undefined, '', { suppressTimestamp: true });
parentWidget?.dispatchEvent({
  type: 'tm-navigate',
  navigateTo: title,
});

parentWidget will work even in foreign layout, if that layout is wrapped within <$navigator story="$:/StoryList" history="$:/HistoryList"


For button to work, Wrap yo…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@linonetwo
Comment options

Answer selected by linonetwo
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant