Hello,

Thanks to Tarek, I was able to add a few attributes to portal members 
very quickly. For the benefit of those who might wish to this and to 
get this in the list archives, I'll briefly describe how I did that 
and then get to my questions.

To add an attribute, say "organization", to the member schema, in the 
ZMI, go to portal_schemas/members and add a field called 
"organization" of the "CPS String Field Type". Put "Manager; Owner" 
in the "ACL: write roles" for your newly created field.

Go to portal_layouts/members, add a "String Widget" with an id of 
"w__organization" (two underscores as per the pattern of the existing 
widget ids), assign "organization" for "Fields", and 
"label_organization" for both the fields for the labels in view and 
edit mode. Then check "Label is i18n". If you want this to be a 
mandatory field, also check "Required widget".

Now click on the Layout tab for "members" and you will see a 
rudimentary layout editor. If you want to add your new widget on the 
same row as an existing widget, select that row and click split cell. 
If you want to add it to a new row, click on the "Add row" button. 
Select "organization" to add the widget to the layout and click on 
the "Change" button.

You should now see the new field in the member preferences form 
(cpsdirectory_entry_view or cpsdirectory_entry_edit). If you had 
selected "Required widget", you should see a red square next to the 
field in the form.

I then tried to add my new "organization" widget to the join_form but 
I couldn't find a layout that corresponds to join_form anywhere. I 
resorted to making a copy of portal_skins/cps_default/join_form into 
portal_skins/custom/join_form and copying/pasting the markup for 
username and replacing "username" with "organization". That modified 
the join form but I have no idea how to indicate that "organization" 
should be a mandatory field. The email address field on that form is 
validated, for example, but it isn't obvious to me how it is being 
validated. I got lost in the layers upon layers of indirection and 
obfuscation.

Questions:

1. How does one assign a string to label_organization? I couldn't find 
it when I did a search for that label in Localizer.

2. How does one change the fields on the join_form? Is the procedure 
not consistent with the layout for the other forms that I was able to 
modify in under 15 minutes? If not, why not?

3. If join_form has to be modified the old-fashioned way, by 
copying/pasting boiler-plate markup, how does one denote a mandatory 
field? Specifically, if I wanted my newly created "organization" 
field represented on join_form as a mandatory widget and wanted to 
ensure it is at least two characters long, how would I do that?
-- 
Regards,

Clifford Ilkay
Dinamis Corporation
3266 Yonge Street, Suite 1419
Toronto, ON
Canada  M4N 3P6

+1 416-410-3326
_______________________________________________
cps-users mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/cps-users

Reply via email to