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

[UX] should we provide a UI for controlling the classes on fields? #2994

Open
jenlampton opened this issue Mar 3, 2018 · 14 comments
Open

[UX] should we provide a UI for controlling the classes on fields? #2994

jenlampton opened this issue Mar 3, 2018 · 14 comments

Comments

@jenlampton
Copy link
Member

Describe your issue or idea

In Backdrop core we provide a UI for selecting classes on blocks and views, but nothing else. In Drupal the Display Suite module, and the Fences module -- and perhaps others -- provide a UI for adding classes to fields. Is this a valuable enough feature that it should be considered for core?

Display Suite UI:
image

@olafgrabienski
Copy link

olafgrabienski commented Mar 3, 2018

Absolutely!

Reading the related issue #2993 about Multiple field settings I remembered a more general discussion about customization of the field display:

Overriding the label text and specify customized HTML... these could be added as features in 1.x before or after any Field UI overhaul. Right now the ability to customize field display is pretty limited (just formatter settings). You're right that we want to allow for more control over markup through the UI and Field module lags behind Layout and Views modules in this regard. If we can pick out specific features and implement them individually, we can progressively iterate to add many of the DS features.

#2084 (comment) by @quicksketch

As the cited comment is of an older issue with some side noise, can we expand this discussion here, so that it is not only about classes but about field display in the Field UI in general? A first step could be to list the available field display options of Views and Block (Layout) configuration.

@jenlampton
Copy link
Member Author

jenlampton commented Mar 4, 2018

A first step could be to list the available field display options of Views and Block (Layout) configuration.

Blocks simply re-use what's already in the field UI. Views does too, with the exception of multiple field settings -- hence that issue. If we were to fix that problem, blocks and views would inherit those improvements too.

The original Field UI issue is about "field display in the Field UI in general", so I don't think we should bring that larger discussion here. It's a doozy.

This would qualify as a sub-issue of the older DS issue. I have turned that issue into a meta, pulled out a list of requested features (most of them are yours @olafgrabienski!) and linked up this one, at least.

@mazzech
Copy link

mazzech commented Mar 4, 2018

Sounds like a great feature to have this in core, cool to see it as a separate new issue. The function might help with any CSS framework with "descriptive" CSS names (e.g. div.uk-article-lead in the UiKit framework)

Perhaps another small example why I like the Dispaly Suite Field functions a lot. Heres the setting to have a Rollover Teaser available for the preview page of a certain content type.

Framework CSS: https://getuikit.com/v2/docs/overlay.html
Display Suite setting (my future screenshots will be in English, promised... but I hope you get the idea)

screen shot 2018-03-04 at 07 50 29
ettings:
screen shot 2018-03-04 at 07 50 52

@mazzech
Copy link

mazzech commented Mar 4, 2018

If I only had read more issues here before posting... it seems that @olafgrabienski has summed up my request some months ago in a much clearer way. We both appear to have a similar way using DS in D7... 100% support from my side what Olaf proposes in #2084. (Let’s further discuss this at DrupalCamp Ruhr later this month!

@jenlampton
Copy link
Member Author

jenlampton commented Mar 5, 2018 via email

@olafgrabienski
Copy link

Yes, thanks @jenlampton for updating the issue description in #2084 !

@olafgrabienski
Copy link

Blocks simply re-use what's already in the field UI. Views does too (...).

Not sure if I understand you correctly. The Views field display configuration for instance is much more flexible than the Content field display configuration. On a Views field, I'm able to

  • create a display label and choose the name of it
  • place a colon after the label, or not
  • customize the field HTML (element and classes)
  • customize the label HTML (element and classes)
  • customize the wrapper HTML (element and classes)

A field block in a Layout is similar. I just need to choose the Dynamic style and will be able to determine HTML elements and classes of wrapper, heading, and content. (AFAIK I'm not able to change the name of the label, though.)

@jenlampton
Copy link
Member Author

My point was that whatever we add to the field UI will also show up in Blocks & views (since Blocks & Views uses that same code). So, if we end up adding field and field-wrapper controls to the filed UI, those will also show up in views & blocks UIs. It will need to be done carefully so that we don't end up with duplicate options in those places when we're done... unless we want them there too?

A thought: This kind of change to something like fields may also have a significant impact on performance. We should do some before/after testing to be sure.

@mazzech
Copy link

mazzech commented Mar 6, 2018

@olafgrabienski regarding Views, a Drupal core developer told me years ago to never use the field mode in Views, but going for the Entity mode instead whenever possible (much better performance). Since then I started to do so in 90% of the cases, and found it to be a much better solution over all. As far as I understand, having a Entity based solution would also help for non-Views scenarios, but also I need to further explore the Backdrop layout system to be sure...

@olafgrabienski
Copy link

@mazzech Thanks for the tip! I agree partially but I've continued to use views fields a lot. You can just do so much with them, and fortunately I've had rarely performance issues so far. So, I use Display suite mainly for full content display and other display modes (e.g. referenced content).

@klonos
Copy link
Member

klonos commented Oct 15, 2022

Should we consolidate/merge this with #2608? (although this question/request here is only for classes, whereas that other issue is about wrapper HTML classes too)

@olafgrabienski
Copy link

Should we consolidate/merge this with #2608?

If you're asking me, yes! As claimed in the last comment of the other issue, in my opinion three related features "would meet the basic needs of many site builders":

  • Change the HTML elements of field item(s) and wrapper (Fences, or Field Wrappers)
  • Add classes to the HTML elements and the label (Fences)
  • Change the name of the label.

@klonos
Copy link
Member

klonos commented Oct 28, 2022

@jenlampton since you opened this issue, do you agree to close it in favor of #2608?

@olafgrabienski
Copy link

@jenlampton Friendly reminder:

do you agree to close [this issue] in favor of #2608?

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

No branches or pull requests

4 participants