【发布时间】:2015-04-14 22:07:22
【问题描述】:
我正在尝试使用钩子在“我的帐户”中隐藏“用户信息”中的一些选项。我只想使用 CSS (style="display:none") 隐藏它。用户信息显示在“我的帐户”页面的右侧。 我想知道,我应该在哪个页面进行更改?在创建挂钩时,我应该选择哪个页面来隐藏“组织、站点等”等链接。请帮忙...
【问题讨论】:
标签: liferay-6 liferay-ide
我正在尝试使用钩子在“我的帐户”中隐藏“用户信息”中的一些选项。我只想使用 CSS (style="display:none") 隐藏它。用户信息显示在“我的帐户”页面的右侧。 我想知道,我应该在哪个页面进行更改?在创建挂钩时,我应该选择哪个页面来隐藏“组织、站点等”等链接。请帮忙...
【问题讨论】:
标签: liferay-6 liferay-ide
您必须通过在 portal-ext.properties 中编写它们来选择您想要的选项卡,如下所示:
#
# 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
每个字段都会链接到它的jsp。例如,“详细信息”将显示 details.jsp。
【讨论】:
由于您的问题是查找 jsp 文件,您应该这样做:
对于您的情况,它是“/portal-trunk/portal-web/docroot/html/portlet/users_admin/edit_user.jsp”
【讨论】:
无法使用 CSS 删除这些选项。我们可以执行以下简单的 Java 代码来删除这些选项卡...我们需要编辑的页面是“/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);
}
使用上面编写的简单 java 代码很容易隐藏这些链接。
【讨论】: