Add Custom Portlet in my Header Liferay 6.2

781 Views Asked by At

I want to add a custom porlet in my header of my liferay, but I don't know how to do it.

I know I can add just content in portal....vm. But for a entire portlet..

Is it possible ?

Thanks in advance.

2

There are 2 best solutions below

2
JMF On

Of course it is possible !! You will have to embed the portlet from the thema for the header or leave the space to be able to enter there your portlet

#set ($portlet_id = '73')
#set ($instance_id = 'E3j7')
#set ($my_portlet_id = "${portlet_id}_INSTANCE_${instance_id})

You need the portlet ID to be able to use it in your header

Documentacion: https://web.liferay.com/es/community/wiki/-/wiki/Main/Embedding+a+portlet+in+the+theme

0
Davide Pedron On

Use this line in your .vm theme file:

$theme.runtime($portletId, $queryString, $velocityPortletPreferences.toString())

You can get Portlet ID from "Look and feel" > "Advanced Styling" of your portlet

If it is something like: #portlet_welcome_WAR_Helloportlet, you will use welcome_WAR_Helloportlet in place of ID in the theme.

To have more information on how this work and how to use correctly this approach i suggest to follow informations you can find here and here.