Allow selecting client-side or server-side trimming

Created on 17 October 2024, 2 months ago

Problem/Motivation

I love smart trim and I'm using it since Drupal 7. Now we had a case, where we didn't want to trim the field server-side, but client-side, so that clicking the more-link makes the text appear.

That's especially relevant if you have contents that should show up short on mobile, but be expandable directly without reload.

I think the options are very very similar and it would be super cool to have a switch in the formatter to just choose between Client-side (JS) and Server-side (PHP) trimming.

https://www.drupal.org/project/expand_collapse_formatter is the alternative for the JS part, but I think smart_trim could do it better and you'd not need different modules and different configuration, if you can just have the switch and the power of smart_trim! :)

What do you think?

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Feature request
Status

Active

Version

2.1

Component

Code

Created by

🇩🇪Germany Anybody Porta Westfalica

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @Anybody
  • 🇩🇪Germany Anybody Porta Westfalica
  • 🇩🇪Germany Anybody Porta Westfalica
  • 🇩🇪Germany Anybody Porta Westfalica
  • 🇩🇪Germany Anybody Porta Westfalica
  • 🇩🇪Germany Anybody Porta Westfalica
  • 🇩🇪Germany Anybody Porta Westfalica
  • 🇩🇪Germany Anybody Porta Westfalica

    @maintainers: Would be great to get some feedback, if you understand and like the idea in general and if it's okay to put it into the main module as a setting within the formatter or if it needs to be a submodule!

  • 🇩🇪Germany lrwebks Porta Westfalica
  • Merge request !102Resolve #3481507 "Allow selecting client side" → (Open) created by lrwebks
  • Pipeline finished with Failed
    about 1 month ago
    Total: 208s
    #337457
  • Pipeline finished with Failed
    about 1 month ago
    Total: 204s
    #341986
  • Pipeline finished with Failed
    about 1 month ago
    Total: 386s
    #342066
  • Pipeline finished with Failed
    about 1 month ago
    Total: 218s
    #342169
  • Pipeline finished with Failed
    about 1 month ago
    Total: 223s
    #342181
  • Pipeline finished with Failed
    about 1 month ago
    Total: 203s
    #344464
  • Pipeline finished with Failed
    about 1 month ago
    Total: 781s
    #344595
  • Pipeline finished with Failed
    27 days ago
    Total: 226s
    #349143
  • Pipeline finished with Failed
    27 days ago
    Total: 267s
    #349169
  • Pipeline finished with Failed
    27 days ago
    Total: 266s
    #349196
  • Pipeline finished with Failed
    27 days ago
    Total: 203s
    #349234
  • Pipeline finished with Failed
    27 days ago
    Total: 201s
    #349255
  • Pipeline finished with Failed
    27 days ago
    Total: 218s
    #349306
  • Pipeline finished with Failed
    27 days ago
    Total: 331s
    #349389
  • Pipeline finished with Canceled
    27 days ago
    Total: 73s
    #349392
  • Pipeline finished with Failed
    27 days ago
    Total: 233s
    #349393
  • Pipeline finished with Failed
    26 days ago
    Total: 223s
    #350658
  • Pipeline finished with Failed
    13 days ago
    Total: 230s
    #363154
  • Pipeline finished with Failed
    13 days ago
    Total: 204s
    #363170
  • Pipeline finished with Failed
    6 days ago
    Total: 325s
    #369914
  • Pipeline finished with Failed
    5 days ago
    Total: 297s
    #370971
  • Pipeline finished with Failed
    5 days ago
    Total: 235s
    #371023
  • Assigned to lrwebks
  • Status changed to Needs review 5 days ago
  • 🇩🇪Germany lrwebks Porta Westfalica

    The base functionality and test coverage is there now, PHPUnit seems to fail due to an unrelated test from a different commit.

  • 🇩🇪Germany lrwebks Porta Westfalica

    Okay, perhaps the pipeline failure isn't that unrelated, I will take a look.

  • Pipeline finished with Failed
    5 days ago
    Total: 210s
    #371033
  • Pipeline finished with Failed
    5 days ago
    Total: 201s
    #371052
  • 🇩🇪Germany lrwebks Porta Westfalica

    Pipeline fixed!

  • Pipeline finished with Failed
    5 days ago
    Total: 209s
    #371054
  • Pipeline finished with Canceled
    5 days ago
    Total: 77s
    #371064
  • Pipeline finished with Failed
    5 days ago
    Total: 205s
    #371066
Production build 0.71.5 2024