Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Showcase Questions /

Feedback and questions about sites in the Community Showcase.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Creating a First Name


Go to End


6 Posts   2874 Views

Avatar
Denny

Community Member, 55 Posts

26 August 2010 at 10:07pm

I am creating a website, and a new user will have to register to use it. Now, after signing up on the site, I want their first name to appear once logged in. How can I do this?

Avatar
Willr

Forum Moderator, 5523 Posts

26 August 2010 at 10:25pm

You can access any of the fields of the currently logged in member by using $CurrentMember. To get the first name you can do $CurrentMember.FirstName. To see all the properties you can call on $CurrentMember look at the Member.php class.

Avatar
Denny

Community Member, 55 Posts

28 August 2010 at 12:14pm

Thank you for your help. The information you provided was excellent.

Avatar
Denny

Community Member, 55 Posts

28 August 2010 at 12:50pm

I was wondering how to create a first and last name?

Avatar
Willr

Forum Moderator, 5523 Posts

28 August 2010 at 1:07pm

Edited: 28/08/2010 1:08pm

I was wondering how to create a first and last name?

Member has a Name function which returns the full name. $CurrentMember.Name

Avatar
Denny

Community Member, 55 Posts

29 August 2010 at 7:14am

I want to thank you help. It works. I wouldn't be able to figure it out without your help.