Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
Great work, thank you very much.
It would be nice if there was a theme setting (under Markup overrides) where one could toggle the display of a colon for a field label.
Cheers, Joep
Comment | File | Size | Author |
---|---|---|---|
#1 | 2059505.patch | 2.84 KB | joep.hendrix |
Comments
Comment #1
joep.hendrix CreditAttribution: joep.hendrix commentedAnd here is the patch against 7.x-3.1.
Comment #2
Jeff Burnz CreditAttribution: Jeff Burnz commentedCool, I wonder if it makes sense to allow for changing the colon, say to a hyphen or em dash etc? Maybe if we did that, and you left it empty it would not show?
Comment #3
joep.hendrix CreditAttribution: joep.hendrix commentedThanks.
When would one need an hyphen or other?
Comment #4
Jeff Burnz CreditAttribution: Jeff Burnz commentedWhen the designer specifies such a thing, with the $colon variable this is pretty simple which is what I like the most about this patch.
Personally I think allowing for a change to the colon is more hassle than it's worth, we have to escape its output by calling check_plain() which is expensive and I try to limit use of that function, basically another pile of code to support what will probably be an edge case.
The $colon variable is the key here, with this we have enough, although I still wonder if we should add span elements around the colon, then at least the themer has a crack at this via CSS alone, e.g. they want to make it different to the label.
Comment #5
joep.hendrix CreditAttribution: joep.hendrix commentedFully agree!
Adding a span is easy enough though I hardly can see why a themer would like to theme the colon itself. The fields around the colon are allready fully themeble.