A difference when rendering a tiddler on its own as against rendering as part of a tab structure

I am seeing a fundamental difference when rendering a tiddler.

  1. If the tiddler is rendered on its own, it shows as expected. See bottom half of the following image.

  1. When it is rendered through a tab structure, no content is displayed. See top half of image above. The technical content should display underneath the Edit Technical button.

In both cases the viewtemplate for the tiddler is as follows

If I remove the list statement from the view template, the rendering through the tab structure is as expected. I have tried replacing the currentTiddler by currentTab but then neither renderings show any content.

The technical tiddler is as follows

Has anyone else noticed this?

I have been wracking my brain trying to find a list filter to cover both eventualities but have failed so far. I am convinced the issue is some incompatibility with the viewtemplate cause he other tabs correctly show their child tiddlers that have no viewtemplate,

Bobj

Try adding:

<$tiddler tiddler=<<currentTab>>>

at the beginning of $:/TLS/ViewTemplateTechnical. This should fix the “show in a tab” issue without affecting the “show on its own” handling.

Why this works:

When shown in a tab, the $tiddler widget sets <<currentTiddler>> to match <<currentTab>>. When shown on its own, the value of <<currentTab>> is undefined, so <<currentTiddler>> remains unchanged.

This “trick” is documented here: tabs Macro (at the bottom of the tiddler)

-e

Sorry @EricShulman your suggestion did not work. I have found a workaround though.

The tiddler with the tabs rendered has a viewtemplate as follows:

This shows the required tabs and the tiddler with the contents of a tab or a message via a $reveal

The Technical tiddler now has the content

As you can see, the display of the contents of what was the view template is now not done via a $:/tags/ViewTemplate tag but via the hard coded <$transclude tiddler=“$:/TLS/ViewTemplateTechnical” /> in the text field of the technical tiddler.

This ends up with

  • the technical details displayed correctly in stand alone mode
  • the technical details displayed correctly in tab mode.

So the issue is with a tiddler displayed via tab mode also having an active viewtemplate filter.

This hard coding means a sort of viewtemplate remains.

bobj

I have this problem too. Templated contents of tiddlers won’t show up in tabs. I set up a Contacts system like this …

Title: Contact Entry Display

Tags: $:/tags/ViewTemplate

Contents:

\define extContactPhoto() [img[Contacts/ContactPhotos/$(file)$]]
<$list filter="[<currentTiddler>prefix[CONTACT -]]">
<h3>{{!!first-name}} {{!!last-name}}</h3>
"""
* ''Address'': {{!!street}} {{!!city}} {{!!state}} {{!!zip}}{{!!country}}
* ''Email'': {{!!email}}
* ''Phone'': {{!!phone}}
* ''Family'': {{!!family}}
"""
</$list>

<$list filter="[<currentTiddler>has[contact-photo]] ">
<$vars file={{!!contact-photo}} >
<<extContactPhoto>>
</$vars>
</$list>

Then I have a contact tiddler for John Doe titled CONTACT - John Doe which is tagged with CONTACTS - (country) - (state) - (town).

This tag in turn is a tiddler with the contents: <<tabs tabsList:“[tag[CONTACTS - (country) - (state) - (town)]]” default:“” class:“tc-vertical”>> and has the tag CONTACTS - (country) - (state)

That tag in turn is a tiddler with the contents:

<<tabs tabsList:“[tag[CONTACTS - (country) - (state)]sort[city]]” default:“” class:“tc-vertical”>> and it is tagged with CONTACTS - (country)

That in turn is a tiddler with the content:

<<tabs tabsList:“[tag[CONTACTS - (country)]]” default:“” class:“tc-vertical”>> and it is tagged with Contacts By Location and so on.

It’s not the prettiest or most efficient and I would so love to see a showcase thread of contact wikis in this forum, but to return to the problem:

Thus I can click on a country tab, and then click a state tab and then click a town tab and then click a contact tab, but the contents of the contact tiddler unfortunately do not show up unless it is something actually written in the text field and not just transluded in like a template.

I would be thankful for any light that can be thrown on this. I looked up the link provided by Eric Shulman and scrutinized Bob Jansen’s final workaround but couldn’t get anything to work.

~ Sapphireslinger

For every ViewTemplate $:/_/Contact/ViewTemplate I have a “tabs-enabler-tiddler” $:/_/Contact/TabsEnabler. This way I can use transcluded fields in the tabs macro.

$:/_/Contact/TabsEnabler:

<$tiddler tiddler=<>>
<$transclude tiddler=“$:/_/Contact/ViewTemplate” mode=“block” />
</$tiddler>

Have look at this example:

Tabs Macro Example Book

If I am reading this correctly, @Bob_Jansen and @Sapphireslinger are looking to use the standard ViewTemplates within the contents of the tabs macro?

If so, you can feed the tab content through the standard ViewTemplate items. Make a new tiddler to bring in the ViewTemplate using currentTab instead of currentTiddler:

title: tab-template-test

code-body: yes

text:

<$let currentTiddler=<<currentTab>>>
{{||$:/core/ui/ViewTemplate}}
</$let>

Then use that tiddler as the template for tabs content:

<<tabs tabsList="[tag[.Grammar]]" template=tab-template-test>>

This will show the entire tiddler chrome as the tab content:

If you want to exclude the tiddler frame, title, tiddler controls, etc… make a copy of the $:/core/ui/ViewTemplate tiddler then edit it down to keep what you need. Use that as the content template:

title: tab-template-test

code-body: yes

text:

\procedure temp-exclude()
   $:/core/ui/ViewTemplate/title
   $:/core/ui/ViewTemplate/subtitle
   $:/core/ui/ViewTemplate/tags
   $:/core/ui/ViewTemplate/classic
   $:/core/ui/ViewTemplate/unfold
   $:/core/ui/ViewTemplate/lazy-loading
\end

<$let currentTiddler=<<currentTab>>>
<$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewTemplate]!is[draft]] :except[subfilter<temp-exclude>]" variable="listItem">
<$transclude tiddler=<<listItem>>/>
</$list>
</$let>

The above is a quick example of only showing personal additions to the ViewTemplate tiddlers: