The short version of my request...

This is a [modified] snip from the admin page of my site at "/admin/structure/types/manage/sell-line-item/display/default".

Looking at the BD documentation, it appears to me that this might be accomplished by adding two booleans to the data structure, and some code to the functions:

  • function number_field_formatter_info()
  • function number_field_formatter_settings_form()

...and others, found in the number.module.

Anybody else think that this would be a cool addition to core?


> Anybody else think that this would be a cool addition to core?

@ericfoy - I hate to suggest this, because I know that it starts to get a bit confusing, BUT if you are interested in suggesting new features for core, you MIGHT want to visit the core issue queue for Backdrop CMS directly.

It's fine to post these issues and suggestions here. One of us will probably move your idea to the core issue queue (if you don't). BUT, if you are so inclined to participate, the interesting discussions about what MIGHT go into core happen in that space and it's perfectly acceptable (and encouraged) for folks like yourself to post messages there, including feature requests.


Have you looked for a contrib module that might meet your needs?

@ericfoy, one quick way to deal with this on a specific field is to create a custom module that implements hook_field_attach_view_alter()  and modify the display value there. This solution will work for specific fields or field types, though, and won't give you the flexibility to specify which fields through the UI.

Alternatively, and while this is discussed in the issue queue, you could create a custom formatter, which involves creating a custom module that implements (at least) the following hooks:

hook_field_formatter_info() - defines the formatter
hook_field_formatter_settings_form() - provides your settings form
hook_field_formatter_settings_summary() - provides a settings summary
hook_field_formatter_view()  - actually performs the trimming

You can find many examples of custom formatters online, and even including one in the Field Example (Examples module)

Okay, now you've got me goin'... I think I have everything I need to create my desired functionality. And what a fantastic learning tool this will be for me!