Filter for hidden fields

I’m editing $:/core/ui/EditTemplate/fields and I’m adding a <details> below the fields table. In here I plan to put the list of all normally hidden fields.
The idea is to copy the field table code and change the filter so that only hidden fields can be displayed.

Unfortunately I’m having difficulty with this filter.

[all[current]fields[]] :filter[lookup[$:/config/EditTemplateFields/Visibility/]!match[hide]] +[count[]!match[0]] +[then[tc-edit-fields]] ~[[tc-edit-fields tc-edit-fields-small]]

I thought optimistically at the beginning that it was enough to remove the “!” in ...!match[hide]]...
But this attempt did not work and neither any other of my attempts sadly.

Could anyone help me?

This filter output a class, to change the items listed in $:/core/ui/EditTemplate/fields you need to modify the config-filter macro:

\define config-filter() [[hide]] :match[title{$(config-title)$}]

If title{$(config-title)$} match hide, it will be listed by the list widget.

1 Like

@Matteo have you concidered the edit field cascade in this design effort?

Seperately;

Althought I have posted recently on including and excluding and sorting view template items in a per tiddler basis, I plan to extend this to the edit mode once its working well.

I was only able to answer now, but I can say that it works.
Thank you @telumire!

Now I’m still making a few changes, when I’m done I’ll share the json so if anyone is interested in similar functionalities they will have it ready for use.

No, I have not. What I wanted to do now was to make a minor change, so I didn’t consider it

Looks interesting!

I spoke too soon. But we’re almost there:
I had tested this tiddler functionalities only in tiddler $:/core/ui/EditTemplate/fields and in New Tiddler to be quick, but sadly not with a tiddler that contains non-hidden fields.
I know, I haven’t conducted the best tests. :sweat_smile:

In the <details> the hidden fields now appear, but the non-hidden ones still appear as well.
Is there a way to make only the hidden ones appear?

Nothing special, but I said I would upload the tiddlers in question and here they are.

$ _core_ui_EditTemplate_fields(1).json (11.1 KB)
$ _style-test.json (716 Bytes)

The problem still remains that all the fields of the tiddler appear in the <details> and not just the hidden ones. I tried to fix it but still couldn’t do it:

I’m currently using this, best attempt at the moment:

Apart from the hidden fields I added the functionality of being able to color distinguish field names based on arbitrarily chosen prefixes.
These colored rectangles that you see in the image also have the function of copying the name of the field. (not very useful to be honest, I was mostly interested in the colors, but at least the button is not selectable)

1 Like

Just an untested hunch, try
[{$(config-title)$}match[hide]]

2 Likes

Tested, it works!
Thank you

Oops, sorry I dont know where the match prefix filter run (?!) came from