Tabs in Stroll

89 views
Skip to first unread message

switchplayer

unread,
Dec 18, 2020, 11:00:02 AM12/18/20
to TiddlyWiki
Hello,

Is there any way to implement tabs in Stroll's functionality? That is, on each tiddler, have tabs appear listing the different types of references (backlinks, tagged, etc). 

I know Drift does something similar, but Drift does not allow you to change the viewing style of the references like Stroll does. 

Still a beginner when it comes to TiddlyWiki development, so unsure of how this would be accomplished. 

Thanks!

David Gifford

unread,
Dec 18, 2020, 11:08:17 AM12/18/20
to TiddlyWiki
Create a tiddler:

Title: $:/.giffmex/ViewTemplate/refstabs

Tag: $:/giffmex/refs 
Caption: Tabs
Dummy: yes

Text:

<span class="viewtemplatebigtext">

<$reveal type="nomatch" stateTitle=<<folded-state>> text="hide" tag="div" retain="yes" animate="yes">

<hr>

<$vars searchme=<<currentTiddler>> searchspx={{{ [<currentTiddler>escaperegexp[]]}}} >

<<tabs ' [!is[system]all[current]backlinks[]!tag[hide]sort[title]] -[is[current]] ' '' '$:/state/tab/strolltabs' 'tc-vertical'>>
</$vars>

</$reveal>

</span>

switchplayer

unread,
Dec 18, 2020, 11:21:59 AM12/18/20
to TiddlyWiki
David,

Thanks so much! 

I just tried adding this, and it appears to create a tab for each reference, which isn't what I'm looking for. Allow me to provide some additional context/clarification, as I realize I was a bit vague...


Currently, I have my wiki set up using Drift for references. So on the bottom of each tiddler, there is a "Backlinks" tab, a "Tagged" tab, and a "Freelinks" tab. 

This works great, but the issue is that it only shows the title of each reference. Often times I am wanting to also have it show the body of the reference as well. 

Stroll is able to accomplish that quite nicely as it gives me the ability to select how I want to view the references. 

So I suppose what I am wanting would be somewhat of a hybrid of Stroll and Drift, where I can have different tabs difference types of references, but within each tab, be able to select how each reference is shown (title only, title + body, title + context, etc).



Let me know if that makes any sense or if I'm just making it worse ;)

si

unread,
Dec 18, 2020, 11:57:50 AM12/18/20
to TiddlyWiki
@switchplayer This might not be what you want, but I'll give a quick explanation of how you could create something like this yourself.

First you want a tiddler to keep your tabs, and then a way to transclude it on every other tiddler.

Create a tiddler called something like $:/switchplayer/references/tabs, and add the text <<tabs "[tag[references]]">>. This uses the tabs Macro to give you a new tab for any other tiddler that is tagged "references". Of course you could choose any tag you want.

Now you want this to appear at the bottom of every tiddler in your wiki, so to do this you add the system tag $:/tags/ViewTemplate.

As of yet you don't have any tabs. You need to create a new tiddler for each tab that you want to see, and within the text of the tiddler create a list of whatever content that you want. Make sure to also give it the tag "references".

So for a simple list of backlinks I might create a tiddler called "Backlinks" and add the following to the text:

<$list filter="[<currentTiddler>backlinks[]]">
<$link><<currentTiddler>></$link>
<br>
</$list>

If I wanted to also transclude the content of each tiddler I might create a tiddler called "Transcluded backlinks" and add the following:

<$list filter="[<currentTiddler>backlinks[]]">
<$link><<currentTiddler>></$link>
<br>
<$transclude tiddler=<<currentTiddler>> mode=block/>
<br>
</$list>

You can now just keep adding new tiddlers with whatever content that you want to display as part of a tab. Hopefully that is helpful.

David Gifford

unread,
Dec 18, 2020, 12:11:34 PM12/18/20
to TiddlyWiki
Hi switchplayer

Another approach using Stroll would be to modify the list filter in each tiddler tagged $:/.giffmex/refs from

filter="[!is[system]all[current]backlinks[]!tag[hide]sort[title]] -[is[current]]"

to

filter="[!is[system]all[current]backlinks[]!tag[hide] [!is[system]all[current]tagging[]!tag[hide] [!is[system]all[current]regexp:text[]!tag[hide]   +[sort[title]] -[is[current]]"

I didn't test it, but this should create one list of all tiddlers backlinking, tagging or with text references to your tiddler. Why have separate tabs if you can see all the references together?


Reply all
Reply to author
Forward
0 new messages