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.
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?
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.
I have a tiddler titled “BUTTON - New Contact”:
\procedure newContact()
<$action-sendmessage
$message="tm-new-tiddler"
title="CONTACT - "
tags="[[River of Contacts]]"
first-name=""
last-name=""
phone=""
email=""
website=""
street=""
city=""
state=""
zip=""
country=""
family=""
notes=""
namecard=""
contact-photo=""/>
\end
<$button tooltip={{$:/language/Buttons/NewContact/Hint}} aria-label={{$:/language/Buttons/NewContact/Caption}} class=<<tv-config-toolbar-class>> actions=<<newContact>>>
<%if [<tv-config-toolbar-icons>match[yes]] %>
{{$:/images/bootstrap/person-plus-fill}}
<%endif%>
<%if [<tv-config-toolbar-text>match[yes]] %>
<span class="tc-btn-text">
<$text text={{$:/language/Buttons/NewContact/Caption}}/>
</span>
<%endif%>
</$button>
How do I get the fields for any tiddler with a prefix of "CONTACT - " to not show up alphabetically in edit mode, but in the required order of:
first-name, last-name, phone, email, website, street, city, state, zip, country, family, notes, namecard, contact-photo
Would appreciate any help. At present I only have a vague idea that it would require a macro sandwiching the altered contents of $:/core/ui/EditTemplate/fields inside a list filter calling for tiddlers beginning with "CONTACTS - " which is probably completely wrong.
PS. Could we start a “Contacts Showcase” thread for people who would like to share their beautiful Contacts setups/demos? Mine is not beautiful so I would love browsing others’ ![]()
You can use the solution I previously provided here: The Order of Fields in Edit Mode - #2 by EricShulman
In $:/config/fieldSortOrder, enter:
first-name last-name phone email website street city state zip country family notes namecard contact-photo
Note that this custom field order will be applied to all tiddlers (not just those starting with "CONTACT - "), and any fields not listed in the $:/config/fieldSortOrder tiddler will be shown first, in alphabetic order.
-e