Fórum

Custom portlet embedded in theme

thumbnail
Muhammed Shafeek V, modificado 10 Anos atrás.

Custom portlet embedded in theme

Regular Member Postagens: 140 Data de Entrada: 22/07/13 Postagens Recentes
Hi,
Someway we can able to embeded portlet into theme by using,
$theme.runtime("autocompleter_WAR_searchtestportlet", '', $velocityPortletPreferences.toString())
.

But its not looking good as we expecting, It shows title and and icons, How to remove these things? for removing I also tryed this,
#set ($VOID = $velocityPortletPreferences.setValue('display-style', '1'))
#set ($VOID = $velocityPortletPreferences.setValue('portlet-setup-show-borders', 'false'))
$theme.runtime("autocompleter_WAR_searchtestportlet", '', $velocityPortletPreferences.toString())
#set ($VOID = $velocityPortletPreferences.reset())


It also not working ,. We are using liferay 6.2 and velosity theme. please help me
thumbnail
Tejas Kanani, modificado 10 Anos atrás.

RE: Custom portlet embedded in theme

Liferay Master Postagens: 654 Data de Entrada: 06/01/09 Postagens Recentes
#set ($VOID = $velocityPortletPreferences.setValue('portlet-setup-show-borders', 'false'))

Try "portletSetupShowBorders" instead of 'portlet-setup-show-borders'.

Best Regards,
Tejas
thumbnail
Muhammed Shafeek V, modificado 10 Anos atrás.

RE: Custom portlet embedded in theme

Regular Member Postagens: 140 Data de Entrada: 22/07/13 Postagens Recentes
Tejas Kanani:
#set ($VOID = $velocityPortletPreferences.setValue('portlet-setup-show-borders', 'false'))

Try "portletSetupShowBorders" instead of 'portlet-setup-show-borders'.




#set ($VOID = $velocityPortletPreferences.setValue('display-style', '1'))
#set ($VOID = $velocityPortletPreferences.setValue('portletSetupShowBorders', 'false'))
$theme.runtime("autocompleter_WAR_searchtestportlet", '', $velocityPortletPreferences.toString())
#set ($VOID = $velocityPortletPreferences.reset())

this too, not working..
https://drive.google.com/file/d/0B1J9UWXesyC-a1c3b0k3LXZQbFE/edit?usp=sharing
thumbnail
Tejas Kanani, modificado 10 Anos atrás.

RE: Custom portlet embedded in theme

Liferay Master Postagens: 654 Data de Entrada: 06/01/09 Postagens Recentes
If you are trying to verify this on page where already a portlet is added, then this will not change it's preference.
This setting will work only when a page is embedding a portlet first time. Once the preference got set, refreshing it with modification in code will not be reflected as portlet's preference is already set.

So you might need to verify it with a new page.
thumbnail
Muhammed Shafeek V, modificado 10 Anos atrás.

RE: Custom portlet embedded in theme (Resposta)

Regular Member Postagens: 140 Data de Entrada: 22/07/13 Postagens Recentes
Hi,

I solved that problem by using this code in my view.jsp
String portletId = "autocompleter_WAR_searchtestportlet";
PortletPreferences portletSetup;
portletSetup = PortletPreferencesFactoryUtil.getLayoutPortletSetup(
layout, portletId);
portletSetup.setValue("portletSetupShowBorders",
String.valueOf(Boolean.FALSE));

portletSetup.store();


Thanks for your help and support.
thumbnail
srikanth velugoti, modificado 10 Anos atrás.

RE: Custom portlet embedded in theme

Junior Member Postagens: 79 Data de Entrada: 24/04/09 Postagens Recentes
Hi shafeek ,

have you tried to add the same property in liferay-look-and-feel.xml file in theme ?
the code looks some thing like below

<theme id="themeid" name="Theme Name">
<settings>
<setting key="portlet-setup-show-borders-default" value="false" />
</settings>
</theme>

otherwise you can use this property in portal-ext.properties file .

theme.portlet.decorate.default=false

HTH,
srikanth
thumbnail
Muhammed Shafeek V, modificado 10 Anos atrás.

RE: Custom portlet embedded in theme

Regular Member Postagens: 140 Data de Entrada: 22/07/13 Postagens Recentes
Thank you for your quick response srikanth.
thumbnail
Mazhar Alam, modificado 10 Anos atrás.

RE: Custom portlet embedded in theme

Regular Member Postagens: 191 Data de Entrada: 25/11/11 Postagens Recentes
Well you can update the border,title etc by updating the look and feel under the portlet settings.