backdrop / backdrop-issues

Issue tracker for Backdrop core.
144 stars 40 forks source link

Add a comma-separated/list field formatter for multi-value fields. #316

Open jenlampton opened 10 years ago

jenlampton commented 10 years ago

We should provide a field formatter that allows people to show a multi-value field as a comma separated list of items. In Drupal 7 this was done by using the https://www.drupal.org/project/field_delimiter module.

Leaving this out will be a regression from Drupal 6. In Drupal 6 you could choose to display taxonomy terms on a node as a comma separated list of links. In Drupal 7, the only way to achieve the same thing was to use the taxonomy formatter module.

I would love to see this common-use-case feature restored to backdrop.

MVP:

Nice to have:

Backdrop contrib module: backdrop-contrib/textformatter

ghost commented 9 years ago

I'll second this request, however I'd also recommend adding the ability to display multi-valued fields as an HTML list (<ul> or <ol>).

Drupal's Text list formatter module does this (and also lets you display the same field as a comma-delimited list).

laryn commented 6 years ago

I think this is the original issue but marking duplicate since the later thread has more activity. https://github.com/backdrop/backdrop-issues/issues/2674

jenlampton commented 5 months ago

Since there is no recent activity on either issue recently, I'm going to switch back to the original since we usually go with the older issue. Copying comments from the newer thread so they are not lost:

Comment from @opi on Jan 5, 2018

I used to have a custom "delimiter" formatter, that allow user to choose the delimiter (like a comma, br tag, ...), and a custom delimiter for the last element ( &, "and", ...) can share the code if needed.

Comment from @jenlampton May 3 2019

Now that https://github.com/backdrop/backdrop/pull/2493 is in, I wonder if that changes how this might be implemented, or if what's in this PR is still the best path forward?

jenlampton commented 5 months ago

I've started on this but this PR is not ready for review yet. Just putting it here in case anyone wants to pick up where I left off. https://github.com/backdrop/backdrop/pull/4712