Varied content inside tab set template

I’m making a template tiddler with a set of about 8 tabs. Each tab opens a different, transcluded iframe tiddler. I want to make 31 sets of these tabs (one for each day of the month), which open different (but similar) sets of transcluded tiddlers. The tab labels will be the same in every set. I’m looking for the most efficient way to set this up. If I make a macro call to the template, how can I then assign the different, transcluded sets of tiddlers to each tab set? Or is.a macro even the best way?

Hi @EdM! It would help us help you if you could explain in a bit more detail:

  • How would you like to see these 31 sets of tabs – should there be 31 tiddlers, each containing a similar tab set? Or do you want to have some UI (tabs)? where you choose one of these “days” to be displayed?
  • Are the tiddlers to be transcluded in the tabs the same for each of the days, or different? If different, is there some structured way of knowing which will it be?
  • This is not a must, but it could help if we could imagine what are you going to use it for. Since you mention days, I guess it is for some kind of planning?

Yeah, I was worried I didn’t make that clear enough. Here’s the use case and hierarchy:

  • Each day of the 31 will have a focus on a different nationality or ethnic group. (This is a one month study experiment I’m testing.)
  • For each day there is a common set of tabs that display categories such as demographics, ethnographics, history, culture, social institutions, politics, religion, etc.
  • Each of those categories are presented on a transcluded iframe tiddler (URLs mostly ours).
  • I just don’t have the skills to compile the hierarchy with the most efficient coding and work-flow.

At the top level, I will either list each nationality or ethne as sliders on one tiddler, or I’ll just keep them in separate tiddlers in a TOC. I’m working out what will be the simplest and easiest UX for people inexperienced with TW, and exploiting TW’s power to drip-feed extensive content with least reducible semantic units of information.

I don’t know how do you keep the URLs for iframes organized. Assuming they are not organized at all and manually selected for each day/category, you could do the following:

  • create tiddler for each day, with fields for the categories (e.g. demographics) which will hold the URLs for iframes
  • create tiddler for each category tab, something like this
title: Demographics tab
caption: Demographics
tags: Tab

<$transclude $tiddler="Iframe template" urlField='"demographics">
  • have a template to display the iframe like this:
title: Iframe template

\parameters (urlField)
<iframe src={{{ [<currentTiddler>get<urlField>] }}} />
  • you could display the tabs in every day by reusing the same template/procedure, but it should be even more flexible by creating a view template which will display on all tiddlers tagged “Day”
title: Day view template
tags: $:/tags/ViewTemplate
list-before: $:/core/ui/ViewTemplate/body

<% if [<currentTiddler>tag[Day]] %>
    <$transclude $variable="tabs" tabsList="[tag[Tab]]" />
<% endif %>

This is one of surely many possible ways to do it.
If you have the URLs for days/categories already organized in some structured way, this could probably be more simple and you wouldn’t necessarily have to create the 31 tiddlers for days.
If you don’t have the data structured in any way yet, structuring it like these (fields in day tiddlers) should be good to start with, as it is easy to understand and trivial to reorganize if needed.

This worked perfectly straight out of the can! With some minor template tweaks, it produced just what I was aiming for. Thank you for the time and attention you gave to it. I copied everything you suggested before fully understanding how it would come out, but now I have time to go back and reverse engineer it in my head to see the why and how. Replicating and customizing the daily tiddlers will be as simple as it can possibly be. Thanks again.

1 Like