Explain the problem as you see it
Currently, there are a small number of options for formatting fields when using them in title expressions. This is limited to:
- Character limited via ${field|#...}
- Placeholder/optionality via ${field|?}
This is extremely limiting. There is no way to add to / transform the content a field used in a title expression without using kludgy workarounds.
Why is this a problem for you?
The core problem it limits the usefulness of title expressions. For example, while it is often useful to display a date in the title of nodes tagged with #todo and the like, these additions to the title become extremely long, especially when a start and end time are part of that date field. By allowing other types of date formatting options (as suggested https://ideas.tana.inc/posts/135-format-date-fields-in-build-in-title), we would gain a lot of flexibility in the way we build titles.
Another case comes from the potential addition of delimiters. Suppose I want to have all todos with a due date have the title structure in (1) and all todos without a due date have the title structure in (2):
(1) todo name | due date #todo
(2) todo name #todo
That is, when there is a due date, it is used in the title but is separated by a vertical line |. Currently. it is not possible to have condition separators without a unpleasant workaround.
Suggest a solution
The core syntax I would suggest is the following:
unformatted field = ${field name}
formatted field = ${field name|<formatting options>}
That is, use the current formatting syntax for title expressions, just expand the options. It would be great to eventually get something like Python f-strings .