Tabs on Tiddlers?

244 views
Skip to first unread message

Black Rook

unread,
Oct 14, 2018, 1:48:07 AM10/14/18
to tiddl...@googlegroups.com
Hello, i'm trying to figure out how to put tabs on Tiddlers to conserve space. I see on wikipedia that some pages (usually for characters or other things like that) usually have an info box with a picture of the person, and sometimes they have tabs above the person that you can press to see alternate pictures of that person. I was wondering if there was any coding that can possibly get that result, every code i've tried doesn't work with Tiddlywiki and i want to somewhat avoid collapsables. I really need help!

Here's an example of what i'm trying to do --->  https://suki-clan.wikia.com/wiki/Template:CursedCharacter#Human

Mat

unread,
Oct 14, 2018, 5:28:31 AM10/14/18
to TiddlyWiki
When you say "on tiddlers", do you mean along the top of the actual tiddler as opposed to the tiddler showing a row of tabs in its content area? Your linked example looks more like the latter, in which case it should not be a problem; just use the tabs macro as it is intended.

If you do mean along the top of the actual tiddler, you would have to clarify e.g what you mean that would show in those tabs. Is it content from other tiddlers or what should it be? BJ has StoryTopTabs which shows all(!) open tiddlers stacked and with tabs, kind of like a browser window.

That said, one could use a trick to make it appear as if the tabs was along the top edge of only the current tiddler by using styling. Basically, you'd use the tabs macro as usual in the tiddler content but then make the tiddlers background transparent and move the tiddler title+tools to somewhere so they are not above the tabs. It's a cool idea actually. Might experiment with it one day (but not now).

<:-)

Black Rook

unread,
Oct 14, 2018, 6:46:55 AM10/14/18
to tiddl...@googlegroups.com
:o Thank you so much! I was looking all over the place for stuff and it was right under my nose all this time. Yeah the tabs macro is what i needed. Yeah I needed the tabs in the actual page instead of on the side where the other tabs are. I see exactly what i need on there but now i'm having issues on where i'm suppose to put the information into each tab exactly. I see how to change the names of the tabs but i don't see where i put the information for the tab pages so to speak.


<<tabs "SampleTabOne SampleTabTwo SampleTabThree SampleTabFour" "SampleTabOne" "$:/state/tab1">>

Mat

unread,
Oct 14, 2018, 10:02:42 AM10/14/18
to TiddlyWiki

Yeah I needed the tabs in the actual page instead of on the side where the other tabs are.

so no misunderstanding; "on the actual page" is known as "the tiddler river". This is just a listing of tiddlers. But also the sidebar with its tabs is actually a tiddler that contains a tabs macro. (In the next update of TW, the sidebar will be easy to edit)
 

<<tabs "SampleTabOne SampleTabTwo SampleTabThree SampleTabFour" "SampleTabOne" "$:/state/tab1">>


Each of those are separate tiddlers, so if you have another(!) tiddler titled SampleTabOne then the content of that tid will show in the tab.

I made http://tablinks.tiddlyspot.com/ to simplify editing tabs. It works well in chrome. I think pmario made another version of it.

<:-)

TonyM

unread,
Oct 14, 2018, 6:49:13 PM10/14/18
to TiddlyWiki
Folks,

I believe the current tabs macro is limited in some important ways such as forcing the content to additional tiddlers when we usually want to ensure the tabs remain associated with the original tab "forever" but it would also be nice to perhaps have the content of macros or transclusions make up tab content sometimes. Default or templated tab content would also be great. I plan to make and publish some solutions to this in the future. Some hint as to how I am thinking can be found in my MyMenus plugin http://tiddlywiki.psat.com.au/mymenus/ that uses fields to define the Menus and their order, as eventually we can use this approach to define define the Tabs and their order.

Regards
Tony

Damon Pritchett

unread,
Jan 25, 2019, 6:52:06 PM1/25/19
to TiddlyWiki
One of the limitations I've noticed with tabs today is that the tiddler content within the tab does not show the comments from the new comments plugin and it does not show content being added via the ViewTemplate (I append some content to all tiddlers matching a certain tag this way. Is there anyway to remedy this?

Thanks as always,

Damon

TonyM

unread,
Jan 25, 2019, 7:57:59 PM1/25/19
to TiddlyWiki
Damon,

The tabs can have a template specified and in this template you include the code that would other wise be included in the view template if you want it to appear in the tab. you can use the <<currentTab>> variable to get the tabs tiddler name in the template. By looking at the items tagged $:/tags/ViewTemplate with the comments plugin you will see $:/plugins/tiddlywiki/comments/footer-view-template-segment is in the view template.

In the tab template, Setting the Current tiddler to currentTab using 
<$tiddler tiddler=<<currentTab>> >
{{||$:/plugins/tiddlywiki/comments/footer-view-template-segment}}
</$tiddler>

Code not tested but expected to work

Here is a tab template of my own, it has not being generalised but it will give some idea to some available tricks such as view and edit inline and comments inside tabs. You will need alternatives to the $:/PSaT tiddlers included.

<$tiddler tiddler=<<currentTab>>>
<$set name=state-tiddler value=<<qualify "$:/temp/edit-tab-toggle">> >

<div style="float:left;">
{{||$:/PSaT/show-subTiddler-tabs/button/view-edit-tab-toggle}}
<<new-in-context>>
</div>
<div style="float:right;background-color: #ccffff;">
{{||$:/core/ui/Buttons/edit}} {{||$:/core/ui/Buttons/open-window}}
<$button tooltip="Actions outside the current tab" class="tc-btn-invisible">{{$:/core/images/info-button}}</$button>
</div>
<div style="text-align: center;">{{!!domain}}: //{{!!description}}//</div>
<p style="text-align: center;"> {{!!tab-title}}</p>

<$reveal type="nomatch" state=<<state-tiddler>> text="yes">
<<view-domain>>
Allow edit-fields-list here in view mode (comes with toggle)
</$reveal>
<$reveal type="match" state=<<state-tiddler>> text="yes">
{{||$:/PSaT/show-subTiddler-tabs/button/view-edit-tab-toggle}}
<$transclude tiddler="$:/core/ui/EditTemplate/body/editor"/>
Allow edit fields here in edit mode  (needs toggle)
</$reveal>
</$set>
{{||$:/plugins/tiddlywiki/comments/footer-view-template-segment}}
</$tiddler>


Regards
Tony

Damon Pritchett

unread,
Jan 26, 2019, 1:40:04 PM1/26/19
to tiddl...@googlegroups.com
Hi Tony,

I tried the simple code you included in a tab template tagged $:/tags/ViewTemplate. The result was the every tiddler displayed the comments stuff twice at the bottom, but the tabs were unaffected. I entered a comment in one of the tiddlers used in the tabs and that comment did not show up in the tab at all, but showed up twice in the tiddler. I'm very new to templates so am not sure how to fix it. Thanks so much for your help and patience.

Damon

TonyM

unread,
Jan 26, 2019, 7:10:27 PM1/26/19
to TiddlyWiki
Daemon,

I expect it is because when the tab is being displayed the currentTiddler value is not correct.

I suggest inserting <<currentTiddler>> and <<currentTab>> in a few places to work out what is happening. Place <hr> below your tabs to show what is tab and what is current Tiddler output.

Test what is happening step by step and you should figure it out. I tested my code and it worked.

Regards
Tony

Damon Pritchett

unread,
Jan 26, 2019, 7:56:55 PM1/26/19
to tiddl...@googlegroups.com
Sorry Tony - being the newbie that I am, I'm not completely following you. The behavior that I'm seeing (two copies of the comments in each tiddler) is happening without the tiddler with the tabs being open. In the new tiddler labeled TabTemplate, it even shows up three times. Please explain for the 1st grader in me.

Damon
Reply all
Reply to author
Forward
0 new messages