Active
Project:
Views Custom Field
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
2 Sep 2009 at 08:42 UTC
Updated:
2 Sep 2009 at 23:14 UTC
Hello,
First and foremost, thank you very much for a great module and the support base!
I was wondering if it is possible to get the initial of the last name in a field.
i.e. Last name: Johnson => to show as "J." in the field
Thank you very much in advance!
Comments
Comment #1
casey commentedor
Comment #2
Bilmar commentedHello casey!
Thank you for the quick support.
Using the above code I am only seeing a " . " for the field in the view.
I'm sorry I forgot to mention that I am using content profile (if it may have an impact on the code).
Also, is it necessary to have any arguments/relationships?
I apologize but not familiar with php programming, and currently starting to learn from guides available online.
Thank you!
Comment #3
casey commented1. You have to add the lastname field to the view (and exclude it from display).
2. I am just using an example variable. You have to find out what the name of the needed variable is. For this you can use
Comment #4
Bilmar commentedFrom what I have learning from php guides in the past week, it just clicked from your explanation!
I will try adding lastname field to the view and exclude it from display, then print_r to get the variable.
As a side note - would this be the only way of doing this?
Thanks casey!