Presenting: Tids-to-Table ~ generate tables from filters

Proudly unleashing:

    Tids-to-Table

This replaces both list-rows and the much earlier list-table-draggable.

Tids-to-Table is simple to use, basically you type <<table>> and you get a little setup form where you fill in the tiddler filter and other settings. The output is a table based on the tiddlers from the filter.

This uses the dynamic power of filters and templates and the fundamentals of html so really complex tables can be generated. This is way more powerful than wikitext pipe | tables and way more efficient than building static html tables. Try it out, I’m pretty sure you’ll like it.

11 Likes

Congratulations Mat! This looks very useful, especially since you should be able to create the equivalent of an SQL “join” table.

A comment about the demonstration. The explanatory text floats over the demo and prevents accessing items on the right side:

image

1 Like

Right - the “power” of a table becomes a matter about the filter!

Thanks for the heads up about the demo. And, by the way, it is thanks to your previous feedback about a need for some some kind of “redo” feature that there is now the button to (re-)enter the setup.

Hi Mat, I notice that it isn’t possible to drag an item to the very last position in the table. This is doable by adding an extra droppable widget after the last table row. The core list* macros use a similar approach.

Good point @saqimtiaz !

And again, thanks for your previous feedback. It was incorporated into this new version!

Very nice Mat!

One very minor point is that the macro <<table>> may confuse pre-existing users of TiddlyTables. Obviously there are several work-arounds that can avoid this, but new users may encounter confusion. The older package is “stable” and unlikely to be updates.

Forum tip: Put code ticks (control-e) around anything in angle brackets, otherwise the forum will attempt to interpret them as HTML tags. e.g. <<table>>

(<<table>>, right?) I’ve never tried TiddlyTables so I was not aware of this but I did consider the risk of previous macros using this most obvious name. I reasoned that it is “very TW” to generate content by means of filtering tiddlers so I, evidently like the author of TiddlyTables for his/her macro, felt it was justified with this name. But as you hint at, if anyone is not happy with this then it is simple enough for that person to just overwrite my macro (and in a single place, if I’m not mistaken, i.e the very macro definition name).

I totally agree that its a minor point and a simple search should clear up any confusion.

If you haven’t seen the other version, a quick peek at this http://tiddlytables.tiddlyspot.com/ may be of interest.

Best,
Hans

1 Like

 
  Updated!

This now allows for dropping the dragged row also at very bottom of the table (as per @saqimtiaz request). The update also has some other code improvements.

1 Like

@pmario wrote:

The demo 3/6 does not allow my to click the Config-Button … It hides from the mouse cursor – I’m almost sure that’s intendend :wink:

Edit: Using FireFox on Widows. … It seems to be OK with Edge

I can’t replicate the issue. Using FF on Windows shows as intended on my machine. Can you tell what might be causing it? In all the demos I added a margin:2em to make the tabled display more prominently - is that relevant for the issue? Are you using some non standard display? I can image that a tight theme, that removes the tiddler gutters, would not like a button that is position:absolute; margin-left:-2.1em; .

EDIT: Maybe this is what you mean: The button easily disappears when you approach it. Yes, this is “intentional” in the sense that you must “enter” it from the table, without “passing” outside of the table on the way there. (.tids-to-table:hover .tids-to-table-ctrl {display:block;}) I figured that users won’t re-enter the settings very often so the button should be accessible but you shouldn’t risk accidentally clicking it when dragging (which is probably a more frequent activity). … But the behaviour should not be different between different browsers… so maybe this is not what you refer to? Or would it be better if I doubled the height of the area for the settings button?

Hi @twMat,

your plugin is awesome.
I have two questions, due the fact that I am using tiddlywiki in an environment where the typical user only want to use the system without any possibilities to edit content.

  1. Is there a possibility to suppress the possibility to change the configuration for the tables. Maybe something like <<table $noedit>> ?
  2. How can I use fields as filter instead of tags. E.g. I only want to generate a table where the field Department is “HR”.

Thx in advance for your support
Stefan

Ah, that’s a very reasonable use case. I should update it to feature this but have no idea when to get around to do that. Here’s a hack to achieve it:

In the tiddler where you apply the macro, add:

<style>
.tids-to-table-<ID> .tids-to-table-ctrl {display:none !important}
</style>

as a user of it, I’m assuming you understand that the <ID> refers to and what it should be replaced with.

How can I use fields as filter instead of tags. E.g. I only want to generate a table where the field Department is “HR”.

Not sure what you mean. You should be able to use any filter, so instead of, say, [tag[foo]] you can use [Department[HR]] or perhaps [all[tiddlers]Department[HR]] - or are you saying that this does not work?

1 Like

Hi @twMat this is beautiful!
I don’t know whether I really just thought seconds before that I need exactly this.
But in effect now I see tons of things that I can use this for.

It would be great if you could tweak the viewtemplate so that you can omit the. <td></td>s and every line automatically forms a column. That should be possible.
And it should be done before too many people have built their tables on your tool

I don’t see how that would be done. The <td> delimits content of “anything” including several rows, paragraphs, other html elements, etc. How would the system know when you want one table cell to end and another to begin?

Besides, tables are typically “one offs” so I think it is OK with a tad of complexity (if that even can qualify as “complex”). This can be contrasted to, say, // for italics or a quick <hr> that can be thrown in without derailing your train-of-thought much.

I think it is possible and could furnish a nice overview - but your argument that you do not need many viewtemplates is very reasonable.

Hi @twMat,

thank you for the answers, I can life with the workaround.

I am unable to solve the the following situation I used your demo Page:

This is the Tiddler with the table:

created: 20240913100018351
creator: MatVonTWaddle
modified: 20240913141358486
modifier: MatVonTWaddle
table-grnf: 
table-grnf-filter: [tag[Info]]
table-grnf-headers: No Link Information
table-grnf-row: <td><<counter>></td>
<td><$link/></td>
<td>{{!!Appendix}}</td>

tags: 
title: test - linked content

<<table grnf>>

This is the Tiddler with the filtered tag:

Appendix: {{Basic Information (Apendix 1)}}
created: 20240913141039484
creator: MatVonTWaddle
modified: 20240913141434014
modifier: MatVonTWaddle
tags: Info
title: Basic Information

Information is the Basic of each decision.

This is the Tiddler named in the field >Appendix<:

created: 20240913141449221
creator: MatVonTWaddle
modified: 20240913141547090
modifier: MatVonTWaddle
tags: 
title: Basic Information (Apendix 1)

Appendix 1:

* Chapter 1
* Chapter 2
* Chapter 3

What looks as this:

This is the result in the browser:

As you see the content of the Tiddler Basic Information (Apendix 1) will be shown as plain text and not rendered.
Is there a possibility to have the rendered Tiddler also in the table?

Thank you for help and explanation
Stefan

@twMat,
Sorry, I posted an issue, but I was wrong.

1 Like

Hello @twMat
…but I have another issue…or better to say request. I would like to use tids-to-table in a view-template for tiddlers that have a certain listfield. This would be easier if it was allowed to feed in filter, viewtemplate and id as params of the macro as well… May I ask you to do this or may I do my own version?

1 Like