Steps to add customAttributes to user registration page:
* Click on control panel > User > Custom attributes > Add Custom attributes.
* Here we need to give a key (name) and type of the field.
* For eg. We will have an Field called Designation added which is a text field.
Key : Designation
Type : Text-field(Indexed) and save.
* Then add the custom attribute taglib in the create_account.jsp in /tomcat/webapps/ROOT/html/portlet/login as follows:
< liferay ui:custom-attribute-list
className="com.liferay.portal.model.User"
classPK="<%= 0l %>"
editable="<%= true %>"
label="<%= true %>"
/>
* But this field will not appear on the create account page because permissions are
not given.
* Hence to permission click on action tab of that custom attribute(here eg.Designation) and permissions
* Here for guest we give permission for view and update.
* Now in the create account page this field will appear.
TO ACCESS the custom fields in portlet
String Designation = (String)currentUser.getExpandoBridge().getAttribute("Designation").toString();
* Click on control panel > User > Custom attributes > Add Custom attributes.
* Here we need to give a key (name) and type of the field.
* For eg. We will have an Field called Designation added which is a text field.
Key : Designation
Type : Text-field(Indexed) and save.
* Then add the custom attribute taglib in the create_account.jsp in /tomcat/webapps/ROOT/html/portlet/login as follows:
< liferay ui:custom-attribute-list
classPK="<%= 0l %>"
editable="<%= true %>"
label="<%= true %>"
/>
* But this field will not appear on the create account page because permissions are
not given.
* Hence to permission click on action tab of that custom attribute(here eg.Designation) and permissions
* Here for guest we give permission for view and update.
* Now in the create account page this field will appear.
TO ACCESS the custom fields in portlet
String Designation = (String)currentUser.getExpandoBridge().getAttribute("Designation").toString();