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, is there a way I can provide a custom action for all text type fields? I'd like to add in an action which runs the fields value through some string functions much like "trim whitespace". I can't find anything on others attempting this and it doesn't seem clear cut from the code as the rewrite stuff lives in the fairly low level field handler class. Thanks!
Comments
Comment #1
saurabh.dhariwal CreditAttribution: saurabh.dhariwal at AddWeb Solution Pvt. Ltd. commentedYou can achieve this by using your
views.tpl.php
file. from your view's "Advanced >> Other >> Theme"i.e.
In your view settings, you can find Theme: Information in group Advanced and you have to add Content: Type in your Fields group.
In your
views-view-fields--xxx--xxx.tpl.php
file write something like:Thanks!
Comment #2
renatogHi guys, how are you? Good morning.
I tested the example in #1 of @saurabh.dhariwal and really works good.
Comment #3
renatog@heylookalive, you can use this example for it.
You can use tpl for it.
Any question you can comment here for us okay?
Thank you very much @saurabh.dhariwal for your contribution.
Good Work.
Regards.