[NOOB] Transclusion, Templates, Filters and Tags vs Fields

989 views
Skip to first unread message

wolfsong

unread,
May 5, 2016, 2:18:56 PM5/5/16
to TiddlyWiki
I'm looking through the documentation and trying to grasp a few concepts but I think I need more information.

I want to setup a knowledge base with articles on a variety of subjects. I'd like to put together a template for each type of article. Each article will have subsections with information that might appear in different types of articles. This way, as content needs to be updated, I can update the relevant tiddler and have the corresponding articles be current. It seems like TiddlyWiki is built around this very idea. Where I'm stumbling though is how to approach the process.
  • Do I create the subsections first and pull them together with a template or create a template that creates the necessary subsections?
  • How do I link the subsections back to the article? Should I use a tag or a custom field (I'm entirely unclear on the advantages of using one versus the other)?
  • Are the some examples that are easy to follow? What I'm finding on the main website seems lite and what I'm finding in the community examples has elements that I can't figure out what's being done.
One other thing, because the articles will be lengthy in some cases, I'd love to take advantage of having the subsections appear as tabs.

Any guidance would really be appreciated. Thanks.

Cristov

wolfsong

unread,
May 5, 2016, 2:42:34 PM5/5/16
to TiddlyWiki
I forgot to mention TW5.

PMario

unread,
May 6, 2016, 2:21:17 AM5/6/16
to TiddlyWiki
Hi Cristov,

TiddlyWiki is great, if you use tags to "combine" your content tiddlers.

transclusions are described here: http://tiddlywiki.com/#Transclusion

list-links macro is one of the simplest macros to start with and get the feeling: http://tiddlywiki.com/#list-links%20Macro

tabs macro is used for tabs: http://tiddlywiki.com/#tabs%20Macro

timeline macro is the one used for the recent tab: http://tiddlywiki.com/#timeline%20Macro

table of content macros are the "most advanced" ones: http://tiddlywiki.com/#Table-of-Contents%20Macros:[[Table-of-Contents%20Macros]]%20[[Table-of-Contents%20Macros%20%28Examples%29]]

-----

The list field is used to get same "manually defined" sorting behaviour: http://tiddlywiki.com/#ListField

and

the filter operators are possible filters. ... but be aware here. ... They can be a bit overwhelming: http://tiddlywiki.com/#Filter%20Operators
Tobias Beer made some "Filters-101" compilation, that may be helpful. .... but do not start here. start at the top of my list!!!! - http://tobibeer.github.io/tb5/#Filters-101

have fun!
mario

Mat

unread,
May 6, 2016, 3:47:13 AM5/6/16
to TiddlyWiki
Hi wolfsong - I think you'll like TW

What pmario says is (of course) correct but here's for a perhaps smaller first piecemeal start:

What you want to do is pretty simple;

What you do is to create a separate tiddler per each article and per each subsection. Tag the subsections with the name of the articles they belong to. The use the tabs macro to filter out (i.e "collect") these subsections and to get them presented as tabs.

You'll probably need a bit more guidance but this is a good start and maybe it'll be enough.

Good luck!

<:-)

Mark S.

unread,
May 6, 2016, 10:29:43 AM5/6/16
to TiddlyWiki
I think we would need to know more about your use case. For instance, what will all these articles have in common that might benefit from a template? How do you imagine using the sub-sections?

Personally, I don't like solutions that clutter tag-space with single-use tags. To me tags seem better to apply semantic meaning to entire categories of tiddlers. But maybe that's just me. I would use links to organize sub-sections.
 
The next version of TW5, 5.1.12 is coming out pretty soon . It will have a tool that will let you quickly cut (excise) your article into relevant sub-tiddlers. This might be the ticket for what you want to accomplish.

Good luck,
Mark

wolfsong

unread,
May 6, 2016, 12:17:18 PM5/6/16
to TiddlyWiki
Thanks for the feedback!

So after looking back through the forum, I was able to piece together a better understanding of tabs and getting transclusion to work with a filter run of multiple tags. Some of the things I couldn't get to work like vertical tabs I found fixes for in the forum; they just aren't documented on http://tiddlywiki.com/.

I think the piece I'm really missing is:
  • understanding how to use a template to pull the tiddlers into a single document
    • should that be done with a tag or field
  • how to keep the tabs in a consistent order once I've filtered the list I want
Like Mark S., tags seem more like broad categories to me and seemingly the title of each article should be in the field of the corresponding subsections.

So far, I have a sandbox doc so I can figure out the concepts and then build my docs. The tiddler called Mammals is what I'm thinking would be an article so I added a field with that name to Dogs & Cats.

I found this post and it's nearly what I need but I want the subsections in a set order for all articles of the same type. it doesn't have to be a form like this solution but I like the title naming convention. I also have a mockup of one of the article types would be so each subsection tiddler could be something like description_ArticleTitle, devices_ArticleTitle, frequency_ArticleTitle, etc. I'm just not following yet how this solution works so that I could change it to suit my needs.

Thanks again for your input.

Cristov
Excentus_AA_Sandbox.html

wolfsong

unread,
May 12, 2016, 4:27:18 PM5/12/16
to tiddl...@googlegroups.com
After looking through the forum a bit I think I need something that's a close to this where I have a template for a tabbed document that separates each section into it's own tiddler. I'm just not certain how to pass the name of to the sections and do this as a template. I have a macro that sorta works in that it creates the tabs when called

\define monitoringtabs(<<currentTiddler>>)
<<tabs tabsList:"[[Description]] [[Devices]] [[Frequency]] [[Script Name]] [[Monitoring Criteria]] [[Alert Trigger Criteria]] [[Immediate Reaction Steps]]" class:"tc-vertical">>
\end

What I'd like the template to actually do is call the macro and create the tabs but with the naming convention of Parent Title: Description, Parent Title: Frequency, etc. but only show the suffix for each of the tabs. Is that possible?

Mat

unread,
May 12, 2016, 5:50:02 PM5/12/16
to TiddlyWiki
Hi wolfsong
In spite of your obvious efforts to make the questions very clear, it's a bit vague to me (what is "a tabbed document" - do you mean a tabbed tiddler? And I certainly don't understand "use a template to pull in tiddlers") ...but I think I got at least a few things. So FWIW;

For getting a tab to show something else than the title of the tiddler it is showing, you use a caption field in the tiddler.

To get vertical tabs, I'm guessing (based on docs, didn't try) that you just put class="tc-vertical" inside the tabs macro, perhaps at extreme right.

In your macro def, I don't think you should include the currentTddler macro call as  an argument. Try to just leav the parameter list empty i.e () and just make the call inside the actual macro where you need it. However, it doesn't look like you're using it so... just skip it.
 
Hope this is of at least some help. But keep on asking for the other stuff.

<:-)

Mark S.

unread,
May 12, 2016, 6:39:12 PM5/12/16
to TiddlyWiki
I think you want a macro like this:

\define monitoringtabs()
<<tabs tabsList:"[[$(currentTiddler)$_Description]] [[$(currentTiddler)$_Devices]] [[$(currentTiddler)$_Frequency]] [[$(currentTiddler)$_Script Name]] [[$(currentTiddler)$_Monitoring Criteria]] [[$(currentTiddler)$_Alert Trigger Criteria]] [[$(currentTiddler)$_Immediate Reaction Steps]]" class:"tc-vertical">>
\end

put that in a tiddler with the tag $:/tags/Macro so that it is globally available.
and then invoke it like this in each of your "parent" tiddlers:

<<monitoringtabs>>


As Mat mentions, the tabs macro will use the caption field for the tab name, so set up each of your child tiddlers with a caption name that reflects the intended suffix.

HTH
Mark

wolfsong

unread,
May 12, 2016, 6:40:32 PM5/12/16
to tiddl...@googlegroups.com
Hi Mat

Yes. I want to create a template for a tabbed tiddler where the parent tiddler and each of the tabs have the same title but the tabs will also have a suffix. This way if I need to edit a tab, I will be able to verify which tiddler is the parent. I maybe looking at doing this the wrong way. Can you explain how the caption field would be used?

I think I have vertical tabs working. Is it class:"tc-vertical" or class=tc-vertical? The parameters are given but not used in the examples on tiddlywiki.com so I'm unclear on what this and other syntax should be.

You're right. I'm not using it because what I tried didn't work and broke the tabs. I tried this:

<<tabs tabsList:"[[<<currentTiddler>>: Description]] [[<<currentTiddler>>: Devices]] [[<<currentTiddler>>: Frequency]] [[<<currentTiddler>>: Script Name]] [[<<currentTiddler>>: Monitoring Criteria]] [[<<currentTiddler>>: Alert Trigger Criteria]] [[<<currentTiddler>>: Immediate Reaction Steps]]" class:"tc-vertical">>

and this

<<tabs tabsList:"<<currentTiddler>>[[: Description]] <<currentTiddler>>[[: Devices]] <<currentTiddler>>[[: Frequency]] <<currentTiddler>>[[: Script Name]] [[<<currentTiddler>>: Monitoring Criteria]] <<currentTiddler>>[[: Alert Trigger Criteria]] <<currentTiddler>>[[: Immediate Reaction Steps]]" class:"tc-vertical">>

but neither works.

Thanks
Cristov

Mat

unread,
May 12, 2016, 8:12:08 PM5/12/16
to TiddlyWiki
Much too late, shouldn't write this as it may be just be... not what you want. But at least it works;

<$set name="aa" filter="[tag[HelloThere]]">
<$macrocall $name="tabs" tabsList=<
<aa>> class="tc-vertical"/>
</$set>

I'm aksing my brain how to put inthe name of currentTiddler there but it tells me nto to disturb it while it's sleeping.

Caption field is just a simple field you name "caption" and give a value "whatever you want todisplay on the tab", i. e the bottom thingy in edit mode. When people talk about some field you've never heard of, it's because it doesn't exist - until you make it. Like the goodnite field. I'll set value to: now.

<:-)

wolfsong

unread,
May 13, 2016, 2:57:54 PM5/13/16
to TiddlyWiki
Mark

This fixed it but after testing it again I really need to dig into this solution and make it work for me. The way I'm doing it creates the tabs but not the actual tiddlers and I may have a case where one of the subsections won't be required. This still helps though because now I know how to make what I was thinking work and I'm getting closer to what I need.

Thanks
Cristov

prog...@assays.tv

unread,
May 13, 2016, 3:07:27 PM5/13/16
to TiddlyWiki
One of the things in TW is how it looks easy, but isn't so always. its very power and flexibility can leave one in a desert of uncertainty. That is my experience of it.
Reply all
Reply to author
Forward
0 new messages