문제

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...

도움이 되었습니까?

해결책 3

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.

다른 팁

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.

Since your problem is finding the jsp file, you should do these :

  1. download the Liferay source, and add the portal-trunk as a Liferay Project in Eclipse
  2. Navigate through the portal to your desired file (manage my account), and get the url from your browser
  3. 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
  4. 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"

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top