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.

eZ debug

Timing: Jan 31 2025 06:27:44
Script start
Timing: Jan 31 2025 06:27:44
Module start 'layout'
Timing: Jan 31 2025 06:27:44
Module start 'content'
Timing: Jan 31 2025 06:27:44
Module end 'content'
Timing: Jan 31 2025 06:27:44
Script end

Main resources:

Total runtime0.0107 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0042 588.1094151.1953
Module start 'layout' 0.00420.0019 739.304736.6172
Module start 'content' 0.00610.0035 775.921994.1250
Module end 'content' 0.00960.0011 870.046937.9922
Script end 0.0107  908.0391 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.001917.6234140.0001
Check MTime0.00098.5818140.0001
Mysql Total
Database connection0.00076.544110.0007
Mysqli_queries0.002018.996130.0007
Looping result0.00000.084810.0000
Template Total0.00087.710.0008
Template load0.00076.186910.0007
Template processing0.00021.441810.0002
Override
Cache load0.00043.959510.0004
General
dbfile0.00022.305680.0000
String conversion0.00000.035740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs