extending user class

Author Message

Vivek Chopra

Wednesday 31 March 2004 4:17:13 pm

I need some help in extending the user class. I am extending the user class to add the address in the user registration form. I added Address as a text field. It shows up ok on the form and stores the data as well. But it doesn't add those fields to the emails.

I want to include the user name and the address in the feedback and confirmation emails.

Need some guidance.
I am on eZ3.3

TIA,

Vivek

Eirik Alfstad Johansen

Thursday 01 April 2004 4:43:18 am

Hi Vivek,

For this purpose, you need to make an override of the user/registrationinfo.tpl template where you include the address info.

Sincerely,

Eirik Johansen

Sincerely,

Eirik Alfstad Johansen
http://www.netmaking.no/

Vivek Chopra

Thursday 01 April 2004 8:20:29 am

Hi Eirik,

Thanks for your reply. I understand that I need to override the registrationinfo.tpl and registrationfeedback.tpl files. But the question is how do I call the address value in these templates.
The login is called by user.login and email by user.email. I have dumped all the attributes and thier values for user variable. The address attribute is not present in the user variable. I am guessing the address is being stored in $contentobject_attribute array in the user variable.
How do I get the value in the template files.

Thanks again
Vivek

Paul Forsyth

Thursday 01 April 2004 8:43:12 am

Would this tutorial be of use?

http://ez.no/ez_publish/documentation/incoming/tutorial_using_userregister

It was written a while ago but it still works fine for 3.3 :)

paul

Vivek Chopra

Thursday 01 April 2004 10:55:06 am

I read this tutorial but didn't find it of much help. register.tpl doesn't need to be overridden since the new fields show up fine without overriding the templates.

I didn't understand the ezurl.tpl modifications in the tutorials.

Vivek

Vivek Chopra

Friday 02 April 2004 10:15:36 am

Finally figured it out.

Thanks for all your help.

Vivek

Iain MacLean

Saturday 03 April 2004 2:59:27 am

Hi Vivek

I've been trying to figure this out myself. How did you do it?

Regards

Iain

Vivek Chopra

Thursday 08 April 2004 11:26:56 am

I didn't have to override register.tpl as mentioned in the tutorial. I did override the registrationfeedback.tpl which sends out the email.

I called the newly added fields in the user class as:
Address:{attribute_view_gui attribute=$user.contentobject.data_map.address}.

Hope this helps.

Now the question is, I am adding forum on my site and users need to register for that. Can I have different signup form/user class for that?

Vivek

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.