[TW5] Viewing tiddler in story vs in other location such as a sidebar tab

75 views
Skip to first unread message

TonyM

unread,
Jan 16, 2018, 1:24:32 AM1/16/18
to TiddlyWiki
Foilks,

I am close to completing a menu tool for TW5 and I am trying to find a way to tell if I am viewing the tiddler in the SideBar or not.

Does anyone know the logic, for a filter that can somehow determine where it is displayed?

For example in the side bar I want it to list the menus
In an open tiddler I also want to offer checkboxes to change settings on the menus.

Ideally with native tiddlywiki since I am building a plugin and want to avoid dependencies.

Thanks in Advance
Tony

BurningTreeC

unread,
Jan 16, 2018, 1:43:25 AM1/16/18
to TiddlyWiki
Hi @TonyM,

I would do it with css, because like that you can address tiddlers in the storyriver with

.tc-story-river .tc-tiddler-frame { ... }

and in the sidebar .tc-sidebar-scrollable (maybe .tc-sidebar-lists if tiddlers are in the sidebar tabs) .tc-tiddler-frame { ... }

and for hiding the menus in the storyriver

.tc-story-river .tc-tiddler-frame .menuclass {
    display: none;
}

.tc-sidebar-scrollable .tc-tiddler-frame .menuclass {
    display: block;

Jeremy Ruston

unread,
Jan 16, 2018, 3:44:22 AM1/16/18
to tiddl...@googlegroups.com
Hi Tony, BurningTree,

The CSS approach is handy but suffers from the disadvantage that the hidden content is still rendered, and thus incurs a performance hit.

An alternative is to take advantage of the “storyTiddler” variable. Within a tiddler in the story river it contains the title of the tiddler, and it is unset by default in the sidebar.

For example, try this in a tiddler tagged “$:/tags/Sidebar"

<$list filter="[<storyTiddler>is[tiddler]]" variable="ignored">
I'm in the story river
</$list>

<$list filter="[<storyTiddler>!is[tiddler]]" variable="ignored">
I'm in the sidebar
</$list>

Best wishes

Jeremy.

-- 
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/6f9bdf68-e139-4a64-8e15-3ee110abad3c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

TonyM

unread,
Jan 16, 2018, 3:47:11 AM1/16/18
to TiddlyWiki
Thanks SO much both of you,

I will use Jeremy's for performance reasons in this case however I will use burning tree's for smaller elements, that I want to control in many places.

Love it

Tony
Reply all
Reply to author
Forward
0 new messages