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.
Problem/Motivation
By default we see remaining length as "Remaining : 10", but for some people will be need see, how many symbols he have now and which maxlength for current field.
Proposed resolution
I propose add support custom template for remaining length row with "tokens", @maxlength, @remaining_count, @length.
Comment | File | Size | Author |
---|---|---|---|
#4 | 2971557-support_template-4.patch | 13.62 KB | r.nabiullin |
Comments
Comment #2
r.nabiullin CreditAttribution: r.nabiullin as a volunteer and at Skilld commentedComment #3
r.nabiullin CreditAttribution: r.nabiullin as a volunteer and at Skilld commentedWith this patch will be opportunity use custom template for each field.
Comment #4
r.nabiullin CreditAttribution: r.nabiullin as a volunteer and at Skilld commentedSame patch with schema.
Comment #5
OleksiyThese replace will override the template which will be used in the Drupal.t() later, that may create confusion with translations. Because a user will want to translate his template without any HTML code.
Maybe will be better to add this tags directly in Drupal.l() when the placeholders set, if they really need here. What do you think?
Comment #6
Jaypan CreditAttribution: Jaypan commentedComment #8
Jaypan CreditAttribution: Jaypan commentedI went at this a different way. In the interests of keeping all settings in a single location, I added this as a setting for the widget, so it can be configured on a per-instance basis. Available message variables are below. Note that the remaining count and current count must be wrapped in an element with the HTML class in the brackets, in order for the value to be auto updated as the user types.
@remaining_count (.remaining_count)
@current_count (.current_count)
@maxlength