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.
Take a field with content "ABC1234567890"
How can this be trimmed to drop the first three positions to get 1234567890 in views, fields and with field_conditional or a module? Trimming 3 gives ABC and -3 drops the 890 which is both wrong. I'm looking to achieve this without using bespoke php code.
Comments
Comment #1
Snehal Brahmbhatt CreditAttribution: Snehal Brahmbhatt at AddWeb Solution Pvt. Ltd. commentedPlease follow below steps.
Step 1: Create your view template file like
views-view-field--your-fieldname.tpl.php
Advanced -> Other -> Theme : information -> Your Field Name : First Name
Step 2: Put below code in your template file.
Hope this helps.
Thanks,
Snehal Brahmbhatt | AddWeb Solution
https://www.drupal.org/user/3147795/track
Comment #2
renatogHi guys, how are you?
I checked and really is possible get the first three positions using
substr($string, 3);
Thank you very much for your help @snehaladdweb.
Regards.
Comment #3
renatog