This wiki does not contain official documentation and is currently deprecated and read only. Please try reading the documentation on the Liferay Developer Network, the new site dedicated to Liferay documentation. DISCOVER Build your web site, collaborate with your colleagues, manage your content, and more. DEVELOP Build applications that run inside Liferay, extend the features provided out of the box with Liferay's APIs. DISTRIBUTE Let the world know about your app by publishing it in Liferay's marketplace. PARTICIPATE Become a part of Liferay's community, meet other Liferay users, and get involved in the open source project. « Dockbar に戻る
Link to Dockbar
Table of Contents [-]
Introduction #
For a lot of Liferay implementations, the dockbar needs to be hidden and the "Add Application" button and the "Layout Templates" button need to be placed on the site body. Unfortunately, doing that has not been the easiest thing to figure out. Fortunately, there does exist an easy way to do it.
Code #
If you place this code anywhere in portal_normal.vm, it links to the "Add Application" container as well as the "Layout Templates" container.
<!-- This can be placed anywhere in the portal_normal.vm -->
<a href="javascript:;" id="addApplications">Add Application</a>
<a href="javascript:;" id="layoutTemplates">Layout Templates</a>
<script type="text/javascript">
AUI().use(
'aui-dialog',
'liferay-layout-configuration',
function(A) {
// Create the Add Applications dialog
var addApplicationsDialog = new A.Dialog({
title: 'Add Application',
width: 280,
visible: false
}).plug(A.Plugin.IO, {
after: {
success: function(event, id, obj) {
Liferay.LayoutConfiguration._dialogBody = addApplicationsDialog.get('contentBox');
Liferay.LayoutConfiguration._loadContent();
}
},
autoLoad: false,
data: {
doAsUserId: themeDisplay.getDoAsUserIdEncoded(),
p_l_id: themeDisplay.getPlid(),
p_p_id: 87,
p_p_state: 'exclusive'
},
showLoading: false,
uri: themeDisplay.getPathMain() + '/portal/render_portlet'
});
// Attach the click listeners to the links
A.one('#addApplications').on('click', function(event) {
addApplicationsDialog.render().show().io.start();
});
A.one('#layoutTemplates').on('click', function(event) {
Liferay.LayoutConfiguration.showTemplates();
});
}
);
</script> 63531 参照数