Problem/Motivation
Views comes with a built-in serialized field handler (Drupal\views\Plugin\views\field\Serialized), which is really great for database columns where data is serialized. However, this field handler plugin only allows limited options for rendering. It is difficult to implement custom rendering of the serialized field.
Proposed resolution
Add an option to use a custom twig template to render the serialized field
Remaining tasks
Patch
Reviews
Commit
User interface changes
A new option in Views UI to use custom twig template to render a serialized field
API changes
None
Data model changes
New "custom_template" key in the views.field.serialized data schema
| Comment | File | Size | Author |
|---|---|---|---|
| #17 | 2636382-17.patch | 2.54 KB | ranjith_kumar_k_u |
| #7 | interdiff.txt | 808 bytes | almaudoh |
| #7 | views_serialized-2636382-7.patch | 2.57 KB | almaudoh |
| #2 | allow_views_serialized-2636382-2.patch | 2.64 KB | almaudoh |
Issue fork drupal-2636382
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
almaudoh commentedFirst patch. Some tests needed.
Comment #3
almaudoh commentedI've created a sandbox at https://www.drupal.org/sandbox/almaudoh/2636494 for anyone who wants to have this in 8.0.x
Comment #4
dawehnerTechnically this is a feature request. Are you sure
Are you sure you actually need to call out to the renderer? Isn't it enough to return the render array as it is?
Comment #7
almaudoh commentedStill needs tests.
Comment #17
ranjith_kumar_k_u commentedThe last patch failed to apply on 9.3, so re-rolled it for 9.3
Comment #23
smustgrave commentedThis issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request as a guide.
With the schema update we will need an upgrade path forward for existing sties.
Also this was previously tagged for tests in #2 which still needs to happen.