TW5 View Template when displaying in tabs?

195 views
Skip to first unread message

Lost Admin

unread,
Mar 3, 2017, 12:16:52 PM3/3/17
to TiddlyWiki
Hi all,

I find I use tabs regularly for a couple of reason. One of which is quick access to lists I edit regularly. To simplify getting to the actual tiddler, I added a button to the bottom of the tiddler that opens the transcluded tiddler in edit mode.

<$button actions="action-sendmessage" message="tm-edit-tiddler" param=<<currentTab>> tootlip="Edit this tab">Edit Tab</$button>

I figured out that I can create a view template and add a filter to add the above button to the bottom of tiddlers with a specific tag. Is there a way to filter based on whether the tiddler is being transcluded or not? It would be nice to only include the button when the tiddler is being displayed in a tab.

Lost Admin

unread,
Mar 3, 2017, 1:16:47 PM3/3/17
to tiddl...@googlegroups.com
Further to my own question ...

I can create a template to use with vertical tabs that consistes of {{!!text}} and the button widget but when I use it with horizontal tabs, it doesn't show the tab content it shows the parent tiddler content.

[Edit:] Correction, the vertical tabs don't work as I expect either. In my test I used a variant of toc, not tabs. So the test is invalid. I have since re-done the test and it doesn't work with either tab layout.

Mark S.

unread,
Mar 3, 2017, 2:12:28 PM3/3/17
to TiddlyWiki
Looking at the documentation, it appears that you can provide a template for transcluding the content of the tabs. Then, inside the template, you can access the current tab as variable currentTab. Perhaps that is useful for what you want?

Good luck,
Mark


On Friday, March 3, 2017 at 10:16:47 AM UTC-8, Lost Admin wrote:
Further to my own question ...

I can create a template to use with vertical tabs that consistes of {{!!text}} and the button widget but when I use it with horizontal tabs, it doesn't show the tab content it shows the parent tiddler content.

Lost Admin

unread,
Mar 6, 2017, 10:47:13 AM3/6/17
to tiddl...@googlegroups.com
I tried, but it's not picking up the {{<<currentTab>>!!text}} transclusion even though it does pick up the rest. To demonstrate, I've created this -> http://thelostadmin.tiddlyspot.com/
 

Lost Admin

unread,
Mar 7, 2017, 11:56:45 AM3/7/17
to tiddl...@googlegroups.com
I've done a bunch of experimenting to try and solve my own problem and I have been left very confused.

When I create the template for displaying the tab like this:

!{{<<currentTab>>!!title}}

<$button action="action-sendmessage" message="tm-edit-tiddler" param=<<currentTab>> tooltip="Edit this Tab">Edit Tab</$button>

I get the button at the bottom and the title of the tiddler, as expected.


When I create the template like this:

{{<<currentTab>>!!text}}

<$button action="action-sendmessage" message="tm-edit-tiddler" param=<<currentTab>> tooltip="Edit this Tab">Edit Tab</$button>

or this:

{{<<currentTab>>}}

<$button action="action-sendmessage" message="tm-edit-tiddler" param=<<currentTab>> tooltip="Edit this Tab">Edit Tab</$button>

I don't get the tiddler content, just the button.

I don't understand why the {{ }} works for some fields but not all?

TonyM

unread,
Jul 8, 2017, 8:06:09 AM7/8/17
to TiddlyWiki
Lost Admin.

I just stumbled here, and wanted a good answer myself. I have just found the ad hoc macro https://tobibeer.github.io/tb5/#Ad-Hoc%20Macro
The Macros name is "="

and  place in any tiddler that may be referenced in a tab
<<= $(currentTab)$>>

This does not appear unless the tiddler is in a tab. Is that what you are after?

I will now try and get it somehow into the viewtemplate or tab macro.

Cheers
Tony
Reply all
Reply to author
Forward
0 new messages