I solved this with conditional templates:

<$list filter="[all[current]doctype[this is the type of document that triggers the tabs]]">


<<tabs "[all[tiddlers+system+shadows]tag[$:/tag]]" "$:/some tiddler" "$:/state/demo" "tc-horizontal">>
</$list>



Then I have the tabs, one tiddler per tab. THey look like this: and of course they are tagged : tag[$:/tag]

<$list filter="[all[current]doctype[this is the type of document that triggers the tabs]]">

Something happens here: like a list. The listed tiddlers might for example have a field with the name of the parent tiddler, and the List-filter calles it with {{!!title}}


</$list>





Am 20.03.2016 um 00:27 schrieb Jeff Vance:
I was playing around with this idea and decided to take a slightly different appraoch. I have something that is almost working, but I'm stuck on 2 issues.

I was thinking it would be more useful to have a tiddler that starts with 1 tab and optionally lets you generate new tabs as you go, adding each tab to the parent tiddler. Looking at the examples, I figured out how to make this work (almost). Each new tiddler will be given a name to be used as the tab caption, the tiddler itself being named with the tab name as a suffix added to the parent tiddler (in theory...it isn't quite working yet).

Here is my experiment in progress, and some details:

http://dl.dropboxusercontent.com/s/pz4th10lqitmp3q/tab_test_wiki.html?dl=0



I created a tiddler "New Tab Form" (see code below), which has 2 edit-text widgets: Tab Title and Text. This form itself has a caption field "+" and it is transcluded as a tab into a view tiddler. So you start out with a single tab that gives you this form with a button to creating another tab:



|
Title:<$edit-text class='tc-edit-texteditor'tiddler='$:/state/NewTabForm'field='name_temp'placeholder='Tab Title'/>

Text:
<$edit-text class='tc-edit-texteditor'tiddler='$:/state/NewTabForm'field='text'placeholder='Tab Text'/>

<$button>CreateTab
<$action-setfield $tiddler="TESTING NEW TAB"text={{$:/state/NewTabForm!!text}}parent={{!!title}}caption={{$:/state/NewTabForm!!name_temp}}/>
<$action-setfield $tiddler='$:/state/NewTabForm'name_temp=''text=''/>
</$button>
|



I wanted the New Tab Form to be able to access the title of whatever tiddler it is transcluded into. This way it can generate a new tiddler using the name of the parent tiddler and add the tab title as a suffix. So if I start a parent tiddler called "Parent", select the new tab form and say I want a new tab called "Summary", the form will generate a new tiddler called "Parent_Summary", but with a caption field of just "Summary".


So I create a system tiddler $:/state/newtab that simply transludes the form as a template like this:

|
{{||NewTabForm}}
|


Then my parent topic gets all the tabs who's parent field is the title of THIS tiddler (plus the form in the last tab to create even more tabs):

|
<<tabs"[field:parent[Test Parent Topic]] [[$:/state/newtab]]">>
|


So this part is basically all working:

  * The form properly gets the the title of the parent tiddler and
    assigns it to the parent field of the new tiddler.
  * The filter in the parent properly generates tabs for all the
    tiddlers who have this assigned as the parent.


So the 2 issues are:

  * I had to hard code the title of the new tiddler (as TESTING NEW
    TAB above). I couldn't figure out the syntax to have it generate a
    unique title by combining the {{!!title}} with the !!name_temp field.
  *  In the parent tiddler, to get the tabs I want, I had to hardcode
    the filter to search on the exact name of the parent tiddler. I
    really want to use *!!title* as the parent field to filter on. But
    this doesn't work.  I can't find any examples of using a text
    reference as an input to filtering on a field (I only see examples
    of doing this for tags).


I feel like I'm really close to making this work.
--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected] <mailto:[email protected]>. To post to this group, send email to [email protected] <mailto:[email protected]>.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/5b79e928-8cfb-42ca-8853-95cd3d6939d6%40googlegroups.com <https://groups.google.com/d/msgid/tiddlywiki/5b79e928-8cfb-42ca-8853-95cd3d6939d6%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/56EDE4B0.8080204%40eclipso.ch.
For more options, visit https://groups.google.com/d/optout.

Reply via email to