How can I show a series of tiddlers as a list of their titles ordered by their created date to also display their associated fields, ideally to only show the fields which begin/contain ‘fieldname’
Edit: Ah, yes that was because I had used the list widget, I have changed it to use the text macro, however I am still trying to work out the correct regular expression for selecting the correct fields, since I imagine you want fields that are both prefixed with fieldname and suffixed with fieldname correct?
I tried your solution and it’s nearly there. The fields are shown as under the tiddler title but they are shown as links (and clicking them goes to ‘missing tiddler’)…?
I think this will be what you’re looking for, took a little tinkering because, if I’m being honest- I sort of forgot you could give variable names to list filters, but anyways, give this a try!
With a tiny modification, you could also have the field next to the field value too, but I just left it as an ordered list just to keep it looking neat.
Just for the sake of anyone attracted by this thread’s title, I’ll put in a plug for Shiraz dynamic tables, and the possibility of doing something like the following (code below):
Display an expandable table with a row for each tiddler that meets a filter condition, and for each such tiddler, display a column for EACH of its fields that meet a filter condition — field name at column-head, field contents in corresponding cell.
Then check out the tiddler for any tag, and see a dynamic table of whatever’s under that tag, with columns for whatever its fields are, minus some of the dull ones, though you could re-include those.
(It would of course be easy to show only those fields that start a certain way, or where the fields themselves are tiddlers with a certain tag, etc.)
Sorry, can’t get that to work - just gives a list of titles with no field info/reference underneath. Perhaps there’s a tweak or two to make which I’m not expert enough to see.
And a variant (worked out before recent reply by @Justin_H) that does not rely on dynamic tables, which works at tiddlywiki.com to illustrate principle. (Using named variables at each level can help keep the code easy to troubleshoot.)
I think making a new filter for [tag[HelloThere]] is a bit of over-engineering and even increases complexity instead of simplifying things. It will also make the code harder to maintain.
can I suggest you leave the bold wikitext out of this field, then you get to choose it when you display it, not when you set it.
I think the addition of the colon addsuffix[: ] belongs in the formatting, not in the general-purpose function. So:
...
\function fieldname-title() [<fieldname>sentencecase[]]
<!-- ^---- remove addprefix -->
...
<li><<fieldname-title>>: <<fieldname-value>></li>
<!-- ^---- here, not in function -->
...
On another topic, I know you’ve been playing with functions a lot. One thing that I know is common in TiddlyWiki that bothers me is nonlocality. It’s demonstrated above by the fact that the calls to fieldname-title and fieldname-value do not pass the field “fieldname”. Instead they reach out to the environment they’re running in to pick up these variables. This would be fine in a nested-function situation, but it bothers me when that doesn’t happen.
Whether this bothers others or not, it’s something I’d like to avoid in my own work. But is there an easy way to pass variables as parameters to the function calls? What I would like is something like this: