Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jenlampton opened this issue Aug 28, 2014 · 4 comments
Open

Comments

@jenlampton
Copy link
Member

jenlampton commented Aug 28, 2014

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:

  • Allow separating items by a comma ,
  • Apply this new formatter to any multi-valued field
  • Allow formatting multi-valued fields as HTML lists (e.g. <ul>, <ol>)

Nice to have:

  • Allow separating items by any custom delimiter (e.g. ,, ;, -, etc.)
  • Allow specifying a different custom delimiter for the last two items (e.g. &)

Backdrop contrib module:
backdrop-contrib/textformatter

@jenlampton jenlampton added this to the 1.x-future milestone Aug 28, 2014
@ghost
Copy link

ghost commented Apr 6, 2015

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).

@ghost ghost changed the title Add a comma-separated field formatter for multi-value fields. Add a comma-separated/list field formatter for multi-value fields. Apr 10, 2015
@laryn
Copy link
Contributor

laryn commented Jan 18, 2018

I think this is the original issue but marking duplicate since the later thread has more activity.
#2674

@jenlampton
Copy link
Member Author

jenlampton commented Apr 19, 2024

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 backdrop/backdrop#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
Copy link
Member Author

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.
backdrop/backdrop#4712

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants