Shiraz - Dynamic Table - Use a Title-Template - HowTo

The second issue has been almost perfectly resolved! There’s no need to make the “header template” of the Shiraz plugin effective for just one tiddler. It’s sufficient to copy and slightly modify the “body template” of Shiraz plugin related to title. Then, just adjust the contents within <<table-dynamic>>.

Taking the Shiraz wiki website as an example, suppose I want to display title as TestSample, and this column still shows the content of the field title.

  1. Clone the tiddler named $:/plugins/kookma/shiraz/templates/body/title, change the value of field tbl-column-list to TestSample, and rename the entry to $:/plugins/kookma/shiraz/templates/body/title-TestSample (this is just for easy identification of what this tiddler does, you can modify the tiddler name as you wish).

  1. In <<table-dynamic filter:"[tag[sample]]" fields:"title email created tags" stateTiddler:"exmp01" caption:"''Table 1. Dynamic table example''">>"""/>, replace title with TestSample, then save. Success! And this does not affect other tiddlers’ dynamic table headers related to the field title.

  1. Note that the “TestSample” column cannot be sorted, because it still displays the value of “title”, and there is no actual field named TestSample. However, I think this is not a problem, as we rarely need to sort by “title”. If you have such requirements, you can create another dynamic table with almost the same parameters, but this time the part will be fields:"title email created tags" stateTiddler:"exmp01". Yes, the sorting state of the two tables will be synchronized, depending on whether the stateTiddler is the same. You can adjust the “title” sorting in the second table, which will affect the sorting status of the first table.

If you want to globally modify a field’s header in dynamic tables and retain the sorting feature, I suggest using the method in this post: Shiraz Dynamic Table Plugin - Column Captions and tbl-column-list

Thanks to everyone who helped me, including the authors of all the information I’ve read.

If there are any errors in the method I’ve written, please point them out. I would be very grateful.

Finally, once you understand the principle, you will naturally find more than one or two methods. Good luck.

1 Like