TWC to TW5 help

277 views
Skip to first unread message

Bob Flandard

unread,
Sep 10, 2015, 5:10:12 PM9/10/15
to TiddlyWiki
Hello,

I'm trying to fully migrate from TWC to TW5

In TWC I had the following code that gave a nicely formatted table with a "summary" column taking the information from the section !!!Summary in each tiddler tagged with apdl AND help.


<<get ##Summary filter:"[tag[apdl AND help]][sort[title]]" table category:"Macro Name">>

How is this done in TW5?

Thank you, Bob

Evan Balster

unread,
Sep 10, 2015, 8:20:57 PM9/10/15
to TiddlyWiki
Something like:

<table>
<$list filter="[tag[apdl]tag[help]]+[sort[title]]">
<tr>
<td>{{!!title}}</td>
<td>{{!!summary}}</td>
</tr>
</$list>
</table>

Where "summary" is a field of the tiddlers in question.  <$list>  is neat -- everything inside is printed once for each element in the list.  You can't use markup with $widgets very well, so you use HTML.

Bob Flandard

unread,
Sep 11, 2015, 4:17:58 AM9/11/15
to TiddlyWiki
Thanks Evan,

That's disappointingly verbose. I was hoping for one line drop-in replacement. Having to resort to HTML for something as simple as a table makes me question what the advantage TW5 over TW2 for the occasional user who doesn't want to fill their TW with metadata.

Bob


Jeremy Ruston

unread,
Sep 11, 2015, 6:00:20 AM9/11/15
to TiddlyWiki
Hi Bob
That's disappointingly verbose. I was hoping for one line drop-in replacement. Having to resort to HTML for something as simple as a table makes me question what the advantage TW5 over TW2 for the occasional user who doesn't want to fill their TW with metadata.

In TW5 you can define global macros that encapsulate re-usable bits of wikitext. Invoking them is as easy as:

<<myMacro "param1">>


Best wishes

Jeremy.
 

Bob


--
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 tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/44c95378-4baf-4254-9f4d-362a93a65e44%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Jeremy Ruston
mailto:jeremy...@gmail.com

Bob Flandard

unread,
Sep 11, 2015, 11:17:00 AM9/11/15
to TiddlyWiki, jeremy...@gmail.com
Hello Jeremy,

Sorry if my post was a bit critical. TW is great, but sometimes a bit opaque for the uninitiated user who just dips in occasionally.

I'll have a look at the global macros.

All the best, Bob

Evan Balster

unread,
Sep 11, 2015, 11:39:42 AM9/11/15
to TiddlyWiki, jeremy...@gmail.com
In a tiddler tagged with $:/tags/Macro --

\define property_table(PROP)
<table>
<$list filter="[tag[apdl]tag[help]]+[sort[title]]">
<tr>
<td>{{!!title}}</td>
<td>{{$$PROP$$}}</td>
</tr>
</$list>
</table>
\end

...And elsewhere in your wiki:

<<property_table !!summary>>

This might seem more complicated by comparison to the old way, but it ends up being a lot more flexible.

Bob Flandard

unread,
Sep 11, 2015, 1:58:26 PM9/11/15
to TiddlyWiki, jeremy...@gmail.com
Hello Evan,

That's very helpful, I appreciate your efforts.

Thanks, Bob

Bob Flandard

unread,
Sep 12, 2015, 8:12:17 AM9/12/15
to TiddlyWiki, jeremy...@gmail.com

Hello,

This code...

\define property_table(PROP)
<table><$list filter="[tag[apdl]tag[help]]+[sort[title]]">
<tr>
<td>{{!!title}}</td>
<td>{{$$PROP$$}}</td>
</tr>
</
$list>
</table>
\end


... didn't do the same thing as this code from TW2

<<get ##Summary filter:"[tag[apdl AND help]][sort[title]]" table category:"Macro Name">>



The TW2 code creates a two column table with column headers "Macro Name" and "Summary"
The first column then contains links to each tiddler in the list and the second column takes its content from a part of the column1 tiddler that has a heading "Summary" e.g: "Does this then the other"

!!!Summary
Does this then the other

!!!Main Body
More Stuff


For the TW5 code above to work (for me), I needed to delete the macro argument and replace
$$PROP$$ with !!summary, having first defined a field in each tiddler called summary. This is really inconvenient because I don't want to define a field, it doubles the amount of data entered for the summary and would require care if I forgot to update the field value after changing the summary text.

Also the first column now lists the tiddlers, but not as links.

Hats off to TW2 for being so succinct and powerful. I can't see how TW5  "
ends up being a lot more flexible"

Thanks, Bob




Evolena

unread,
Sep 12, 2015, 9:11:02 AM9/12/15
to tiddl...@googlegroups.com
Le samedi 12 septembre 2015 14:12:17 UTC+2, Bob Flandard a écrit :
For the TW5 code above to work (for me), I needed to delete the macro argument and replace $$PROP$$ with !!summary, having first defined a field in each tiddler called summary. This is really inconvenient because I don't want to define a field, it doubles the amount of data entered for the summary and would require care if I forgot to update the field value after changing the summary text.

Sections no longer exists in TW5.
If you don't want to duplicate your summary text, but still have it both in the field and in the text, you can transclude the summary field in the tiddler's text:

!!! Summary
{{!!summary}}

 
Also the first column now lists the tiddlers, but not as links.
 
So replace the transclusion of the title by a link to it:
<$link to={{!!title}}><$view field="title"/></$link>
(a macro or a template for this is useful, it ends to be often used; a template already exists but with a class that we don"t always want: $:/core/ui/ListItemTemplate)

 
Hats off to TW2 for being so succinct and powerful. I can't see how TW5  "ends up being a lot more flexible"
 
I don't remember this get macro from TWC, but I can imagine that there is also a whole logic and code behind it to have it work. Only its call is succinct. So to reproduce a macro someone else defined in TWC and that don't exist identically in TW5, you have to define it yourself, and so the illusion of being less succinct.

The macro definition could also be changed to be less hard-coded and take more parameters.

This code...

\define property_table(PROP)
<table><$list filter="[tag[apdl]tag[help]]+[sort[title]]">
<tr>
<td>{{!!title}}</td>
<td>{{$$PROP$$}}</td>
</tr>
</
$list>
</table>
\end


... didn't do the same thing as this code from TW2

<<get ##Summary filter:"[tag[apdl AND help]][sort[title]]" table category:"Macro Name">>



The TW2 code creates a two column table with column headers "Macro Name" and "Summary"
The first column then contains links to each tiddler in the list and the second column takes its content from a part of the column1 tiddler that has a heading "Summary" e.g: "Does this then the other"

!!!Summary
Does this then the other

!!!Main Body
More Stuff


For the TW5 code above to work (for me), I needed to delete the macro argument and replace
$$PROP$$ with !!summary, having first defined a field in each tiddler called summary.

 The headers of the table can be added.

<thead><tr>
<td>Macro name</td>
<td>Summary</td>
</tr></thead>




So you should end with something like that for the macro definition:

\define property_table(section_field, filter, list_header)
<table><thead><tr>
<td>$list_header$</td>
<td>$section_field$</
td>
</tr></thead>
<$list filter="$filter$">
<tr>
<td><$link to={{!!title}}><$view field="title"/></$link></td>
<td>{{!!$section_field$}}</td>
</tr></$list>
</table>
\end

It would the be called with parameters :

<<property_table summary "[tag[apdl]tag[help]]+[sort[title]]" "Macro name">>

(This is not very different from your old <<get ##Summary filter:"[tag[apdl AND help]][sort[title]]" table category:"Macro Name">> )

And yours tiddlers will look like that:

!!!Summary
{{!!summary}}

!!!Main Body
More Stuff

Bob Flandard

unread,
Sep 12, 2015, 10:08:05 AM9/12/15
to TiddlyWiki
Hello Evolena,

Thanks for spoon-feeding me the exact macro I wanted. It works perfectly! I will make the effort to try and understand it though.

I think the original TW2 macro/plugin was one of Eric S's fine creations.

All the best, Bob



Eric Shulman

unread,
Sep 12, 2015, 10:49:14 AM9/12/15
to TiddlyWiki
To the best of my recollection, I never wrote a macro named <<get>>.

I did write the "MatchTags" plugin that adds boolean tag matching to the core's filter syntax as well as GridPlugin, which generates table output from tiddler fields, slices, and sections.  But I have no idea who created the <<get>> macro you are using.

You might be able to find the actual plugin definition if you search your document for a tiddler tagged with systemConfig that contains the text "config.macros.get".

-e
 

Bob Flandard

unread,
Sep 12, 2015, 4:07:57 PM9/12/15
to TiddlyWiki
Hello Eric,

'Twas Tobias Beer. http://get.tiddlyspace.com/#GettingStarted

About 60% of the plugins in my TW2 are thanks to you, so thanks to you! (and JR and PM and TB - not tuberculosis you understand)

All the best, Bob




Tobias Beer

unread,
Sep 15, 2015, 9:21:54 AM9/15/15
to TiddlyWiki
hi Bob,

This technique will surely be of interest to you...


— tb (not tuberculosis ;-)

Hegart Dmishiv

unread,
Sep 18, 2015, 5:21:35 PM9/18/15
to TiddlyWiki
Sorry all, a real n00b question here. What is the purpose of the summary field anyway? All of my content tiddlers in my main TW wiki have one liner's at the top, describing the purpose of the tiddler. I guess you could call that the summary. But they're just regular wikitext, not in a tiddler field. What would be the advantage of putting them into a field?

Bob Flandard

unread,
Sep 18, 2015, 5:54:29 PM9/18/15
to TiddlyWiki
Hello Hegart,

For me there was no advantage except that it seems that currently TW5 is unable to transclude a fragment of a tiddler (this was possible in TW2 with a plugin from tb) and I wanted just a summary section from each tiddler to be included in a tabulated list of tiddlers filtered by tags.

All the best, Bob

Hegart Dmishiv

unread,
Sep 18, 2015, 6:13:45 PM9/18/15
to tiddl...@googlegroups.com
Ah, thanks for explaining that @Bob. Coming from MediaWiki myself, I understand what you're saying to be the very handy Labeled Section Transclusion (LST) extension. Yes, that would be a helpful feature indeed, but it seems that the focus of TW5's core develepment team is on "tiny tiddlers" that are transcluded into larger tiddlers as sections, so with that mindset, there isn't a need for LST, as each section is itself a transcludable self-standing tiddler. Personally I prefer single long pages with sections, and the ability to transclude out sections as you've mentioned. From what you've described I could do this using multiple tiddler fields. Then every section of my tiddler would only contain the code for importing the relevant tiddler field. That would mean that all editing would need to be done within a tiddler field, rather than on the page itself. And as seen elsewhere, tiddler fields are only single-line textboxes at present, not expandable text areas, making editing of long paragraphs within them difficult. I could edit the field contents on the page, then cut/paste into the field. Hmm, I'll have to think more on that. Thanks again for explaining.

Tobias Beer

unread,
Sep 18, 2015, 7:19:04 PM9/18/15
to tiddl...@googlegroups.com
Hi Hegart,

The main reason I use the summary field, e.g. in

http://tobibeer.github.io/tb5/

is to display it as a stub in aggregated lists,
so that you can see what a tiddler is about before clicking.

Not sure if it was you mentioning info-boxes the other day.
Think of it as reusing info-box contents in lists,
only just reduced to... a summary.

I use this method extensively,

Best wishes,

— tb

Hegart Dmishiv

unread,
Sep 18, 2015, 7:27:58 PM9/18/15
to TiddlyWiki
Wow, that's cool Tobi, thanks for sharing that. Currently I'm just using a simple "stub" tag to indicate stubs, and then I navigate to More > Tags > stub in the sidebar to view the list, which of course only lists the tiddler titles.
Reply all
Reply to author
Forward
0 new messages