The Order of Fields in Edit Mode

When you edit a tiddler, is there a simple way to display the fields at the bottom of tiddler in a custom order?
It seems TiddlyWIki in edit mode show fields of tiddler sorted by title.

Edit shadow tiddler $:/core/ui/EditTemplate/fields and change this line:

<$list filter="[all[current]fields[]] +[sort[title]]" variable="currentField" storyview="pop">

to

<$list filter="[all[current]fields[]] +[sort[title]sortby{$:/config/fieldSortOrder}]" variable="currentField" storyview="pop">

Then, create a tiddler named $:/config/fieldSortOrder and in the text field, enter the names of the fields, space-separated, in the desired custom order. Fieldnames that are not listed will be shown first, in default alpha order, followed by listed fields in the order specified in $:/config/fieldSortOrder.

4 Likes

Works as expected. Thank you Eric.

This is a great solution! I have templates like “People” and want the field to be arranged in order of importance rather than alphabetically.

@jeremyruston
Would it be possible to include a hidden setting or a configuration tiddler, as mentioned above, to let users customize the order of fields in edit mode without altering the shadow core tiddlers?

2 Likes

Yes, I’m sure that would be possible. I would be inclined to approach it as a customisable filter that returns the names of fields in the required order. I don’t think it is helpful to make it possible to hide fields in edit mode, and so it would be necessary to also include any fields that are not specified by the filter.

1 Like

Also see GH issue: [IDEA] cascade to provide field-list to tiddlers in both edit and view templates · Issue #6621 · TiddlyWiki/TiddlyWiki5 · GitHub