Skip to main content

Display portlet as popup in theme

Step 1: Open the portal-normal.vm file and write the below code.

 portal-normal.vm 

#set ($popupUrl = $portletURLFactory.create($request,"login_WAR_portlet",$page.getPlid(), "RENDER_PHASE"))
$popupUrl .setParameter("p_p_state", "exclusive")
$popupUrl .setPortletMode("view") 


 <a href="#" onClick = "showPopup()">Show Popup </a>

where 'login_WAR_portlet' is the portlet name.

  
Step 2: Write the javascript code for popup in portal-normal.vm or any other .js file.



<aui:script>
AUI().use('aui-base',
'aui-io-plugin-deprecated',
'liferay-util-window',
function(A) {
function showPopup(){
var popUpWindow=Liferay.Util.Window.getWindow(
{
dialog: {
centered: true,
constrain2view: true,
//cssClass: 'yourCSSclassName',
modal: true,
resizable: false,
width: 475
}
}
).plug(
A.Plugin.IO,
{
autoLoad: false
}).render();
popUpWindow.show();
popUpWindow.titleNode.html("Liferay 6.2 Dialog Window");
popUpWindow.io.set('uri','$popupUrl');
popUpWindow.io.start();
}
});
</aui:script>

Step 3: Open liferay-portlet.xml add the following line.

<add-default-resource>true</add-default-resource>

Comments

  1. Impressed alot.I really like your blog.Thanks for the post. Pop up System Services in Malaysia

    ReplyDelete
  2. The blog was absolutely fantastic! Lot of information is helpful in some or the other way. Keep updating the blog, looking forward for more content...Great job, keep it up.
    Pop Up System services in Malaysia

    ReplyDelete
  3. Really nice info you posted thanks for sharing this with us. We provide Pop Up strategies.

    ReplyDelete

Post a Comment

Popular posts from this blog

Liferay 7 overriding MVC Commands

MVCActionCommand : An interface that allows the portlet to process a particular action request. By extending  BaseMVCActionCommand , we can customize processAction method. MVCRenderCommand : An interface that handles the render phase of the portlet. By   extending  BaseMVCRenderCommand , we can customize render method. MVCResourceCommand : An interface that allows the portlet to serve a resource. By  extending  BaseMVCResourceCommand , we can customize serveResource method. Now , we will see how to customize processAction method. Step 1: Initially, Create one module as mentioned in Liferay 7 document. Step 2: In controller class, write the component property depends on which modules you are customizing, for eg., if we customize create account page, write as following @Component( property = { "javax.portlet.name=com_liferay_login_web_portlet_FastLoginPortlet", "javax.portlet.name=com_liferay_l...

Migrating a Legacy Liferay DXP Theme to Client Extensions

Migrating a legacy WAR-based Liferay theme to modern Theme CSS and JavaScript Client Extensions is an important step toward a more modular, maintainable, and upgrade-friendly Liferay DXP architecture. Traditional themes package styling, JavaScript, templates, and static resources together in a deployable WAR. With client extensions, you can separate styling and JavaScript from the core portal runtime, simplify deployments, and reduce dependencies on traditional theme modules. This guide explains how to analyze a legacy theme, migrate its components to client extensions, reorganize project files, configure the required YAML files, and apply the new extensions to Liferay pages. 1. Understand the Traditional Theme Components Before starting the migration, identify the components used by your existing theme and determine their modern Liferay equivalents. Legacy theme component Recommended replacement portal_normal.ftl Master Pages, Page Templates, and supported page configuration options ...

Embed portlet in liferay 7 FTL theme

To include portlet in liferay 7 ftl theme , use the code as follows. <@liferay_portlet["runtime"] defaultPreferences="${freeMarkerPortletPreferences}" portletProviderAction=portletProviderAction.VIEW instanceId="blablabla1" portletName="com_liferay_site_navigation_directory_web_portlet_SitesDirectoryPortlet" /> where , instanceId="blablabla1" have to be given only for instanceable portlet, "com_liferay_site_navigation_directory_web_portlet_SitesDirectoryPortlet" is portletId.