I am trying to hide some options in "User Information" from My Account by using hook. I just want to hide it using CSS (style="display:none"). User Information is present in the right side of My Account Page. I want to know, in which page I should make changes? While creating hook which page I should select for hiding those links like "Organizations, Sites, etc." Please help...
Asked
Active
Viewed 2,566 times
3 Answers
4
You have to choose the tab you want by writing them in the portal-ext.properties as follow :
#
# Input a list of sections that will be included as part of the user form
# when updating a user in the My Account portlet.
users.form.my.account.main=details,password,organizations,sites,user-groups,roles,personal-site,categorization
users.form.my.account.identification=addresses,phone-numbers,additional-email-addresses,websites,instant-messenger,social-network,sms,open-id
users.form.my.account.miscellaneous=announcements,display-settings,comments,custom-fields
Each field will be linked to its jsp. For exemple, "details" will display details.jsp.

Pierre-François F
- 41
- 2
1
Since your problem is finding the jsp file, you should do these :
- download the Liferay source, and add the portal-trunk as a Liferay Project in Eclipse
- Navigate through the portal to your desired file (manage my account), and get the url from your browser
- Search for the "struts_action" attribute in the usl. For this case, it's "/my_sites/view" This is very helpful as the first parameter indicates the portlet that controls the jsp page. The second parameter usually is the jsp you are searching for
- Find that file in the portal trunk and search for the html component you want to edit. it might be in the page itself, or it could be on an included one, or a sibling one (provided as a tab)
For your case, it's "/portal-trunk/portal-web/docroot/html/portlet/users_admin/edit_user.jsp"

yannicuLar
- 3,083
- 3
- 32
- 50
-
Thanks for the reply. But its not possible to hide those links by using css. I hide it using some java code. Posting as answer. – Boat Feb 02 '13 at 05:24
-
Yep, the way the links are set, you had to write some java code. I only tried to help you identify the file, since that's what you asked for. Glad you've worked it out – yannicuLar Feb 02 '13 at 11:04
-
Yeah, after analyzing that page only I understood that my plan (Hiding using CSS) will not work :-( . Thanx for helping to find it. Please have a look in to http://stackoverflow.com/questions/14659374/how-to-get-server-name-and-server-port-from-liferay-velocity-template... – Boat Feb 02 '13 at 11:41
1
It is not possible to remove those options using CSS. We can do the following simple java code for removing those tabs... The page which we need to edit is "/portal-trunk/portal-web/docroot/html/portlet/users_admin/edit_user.jsp".
List<String> identificationList = new ArrayList<String>();
for(String identificationItem : identificationSections){
identificationList.add(identificationItem);
System.out.println(identificationItem);
}
identificationList.remove("websites");
identificationList.remove("instant-messenger");
identificationList.remove("social-network");
identificationList.remove("sms");
identificationList.remove("open-id");
identificationSections = new String[identificationList.size()];
for(int i = 0; i < identificationList.size(); i++){
identificationSections[i] =identificationList.get(i);
}
Its easy to hide those links by using the simple java code written above.

Boat
- 515
- 2
- 8
- 28