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

Duplicate: Provide commonly used formatters for fields in core #2674

Closed
jenlampton opened this issue May 7, 2017 · 11 comments
Closed

Duplicate: Provide commonly used formatters for fields in core #2674

jenlampton opened this issue May 7, 2017 · 11 comments

Comments

@jenlampton
Copy link
Member

jenlampton commented May 7, 2017

We should provide more field formatters to cover the most common use-cases for the display of multiple values.

Suggestions include:

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.

Here's a summary of sorts for these requests:

  • Apply this new formatter to any multi-valued field
  • Allow separating items by a custom delimiter (e.g. ,, ;, -, etc.)
  • Allow formatting multi-valued fields as HTML lists (e.g. <ul>, <ol>)
  • Allow specifying a different custom delimiter for the last two items (e.g. &)

Modules to use for inspiration:

  • https://www.drupal.org/project/taxonomy_formatter (This module adds a new formatter that allows you to specify the element type, the wrapper type, classes for both, the separator used, and if they link to the term pages or not. This gives much more customizable layout options.)
  • https://www.drupal.org/project/field_delimiter Field Delimiter provides an additional setting for field formatters, allowing multi-value fields to be displayed with a delimiter between the values.
  • https://www.drupal.org/project/textformatter This module provides a field display formatter to render field values as HTML or comma-separated lists. This can currently be used on all core field types (text, long text, number, list, and taxonomy reference etc..) and some contributed fields. (see below).
@laryn
Copy link
Contributor

laryn commented May 7, 2017

Agreed that this would be good in core. This module also allows it in contrib for now:
https://github.com/backdrop-contrib/textformatter

@jenlampton jenlampton added this to the 1.8.0 milestone May 11, 2017
@jenlampton
Copy link
Member Author

jenlampton commented May 11, 2017

Even better! A module that allows it for all field types :)
Selfishly adding milestone :)

@jenlampton jenlampton self-assigned this Aug 17, 2017
@jenlampton jenlampton changed the title Add a "Delimited" field display option for Taxonomy Terms [UX] Add a "Delimited" field display option for Taxonomy Terms Aug 17, 2017
@jenlampton
Copy link
Member Author

I really want this feature, but with 2 weeks before code freeze and a fantastic contrib solution already, it's not a priority for 1.8. I'm going to bump the milestone to 1.9.

@jenlampton jenlampton modified the milestones: 1.9.0, 1.8.0 Aug 18, 2017
@opi
Copy link

opi commented 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.

@jenlampton jenlampton removed this from the 1.9.0 milestone Jan 15, 2018
@jenlampton
Copy link
Member Author

jenlampton commented Jan 16, 2018

I seem to have a PR for this, but I'm not sure what state it's in. Pushing here so I don't loose it...

@ghost
Copy link

ghost commented Jan 18, 2018

Copying ideas from the other duplicate issue, it'd be great to also allow displaying multi-value fields as <ul> or <ol> as well.

So here's a summary of sorts for these requests:

  • Apply this new formatter to any multi-valued field
  • Allow separating items by a custom delimiter (e.g. ,, ;, -, etc.)
  • Allow formatting multi-valued fields as HTML lists (e.g. <ul>, <ol>)
  • Allow specifying a different custom delimiter for the last two items (e.g. &)

Modules to use for inspiration:

Modules already ported to Backdrop contrib:

Feel free to copy this to the original post above if it's helpful, and to edit at will.

@jenlampton
Copy link
Member Author

I keep needing this feature, and get grumpy when I need to add textformatter. Adding the milestone review tag to see if this might be a good issue to schedule for the next minor release.

@jenlampton
Copy link
Member Author

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?

@klonos
Copy link
Member

klonos commented May 3, 2019

@jenlampton the PR is not linked anywhere.

@jenlampton
Copy link
Member Author

jenlampton commented May 3, 2019

Well, I tried to make a new PR from my branch but GitHub said there were no differences in the code. I'll need to make a new one.

@klonos klonos changed the title [UX] Add a "Delimited" field display option for Taxonomy Terms Provide "Delimited" and "HTML list" display formatters for fields May 18, 2020
@jenlampton jenlampton reopened this Apr 19, 2024
@jenlampton jenlampton changed the title Provide "Delimited" and "HTML list" display formatters for fields Provide more commonly used formatters for fields in core Apr 19, 2024
@jenlampton jenlampton changed the title Provide more commonly used formatters for fields in core META: Provide more commonly used formatters for fields in core Apr 19, 2024
@jenlampton jenlampton changed the title META: Provide more commonly used formatters for fields in core [META]: Provide more commonly used formatters for fields in core Apr 19, 2024
@jenlampton jenlampton changed the title [META]: Provide more commonly used formatters for fields in core [META]: Provide commonly used formatters for fields in core Apr 19, 2024
@jenlampton jenlampton changed the title [META]: Provide commonly used formatters for fields in core Duplicate: Provide commonly used formatters for fields in core Apr 26, 2024
@jenlampton
Copy link
Member Author

Resuming work on #316

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

4 participants