Fórumok

Adding portlet to a theme

Yannick Ongena, módosítva 14 év-val korábban

Adding portlet to a theme

Junior Member Bejegyzések: 26 Csatlakozás dátuma: 2010.02.22. Legújabb bejegyzések
Is it possible to add a portlet to a custom theme?
For example i have a custom menu portlet with specific items based upon the user and some kind of data.
It is build in a portlet but currently i add this manually to each page.
Is is possible to add this in the template so i won't need to add this on each page?
thumbnail
Corné A, módosítva 14 év-val korábban

RE: Adding portlet to a theme

Liferay Legend Bejegyzések: 1313 Csatlakozás dátuma: 2006.10.03. Legújabb bejegyzések
Try

$theme.runtime("YOUR_PORTLET_ID", "", $velocityPortletPreferences.toString())

or 

<div align="right" class="login">
$theme.runtime("58")
</div>




Greetings,
Corné
thumbnail
Erik Andersson, módosítva 14 év-val korábban

RE: Adding portlet to a theme

Junior Member Bejegyzések: 39 Csatlakozás dátuma: 2008.04.08. Legújabb bejegyzések
Hi Yannick,

If you have a custom portlet (i.e. not one of the core Liferay portlets), you must also add some information about which WAR file the portlet resides in when including a static portlet.

1. To include a core Liferay portlet that is NOT instancable - do as Corné proposes

2. To include a core Liferay portlet that IS instancable - add an instance reference to the run time:

$theme.runtime("56_INSTANCE_qyqy", "", $velocityPortletPreferences.toString())


3. To include a custom portlet with portlet id "myportlet" that is deployed in the plugin "myplugin":
$theme.runtime("myportlet_WAR_myplugin", "", $velocityPortletPreferences.toString())


4. The velocity preferences can be used for example to remove the portlet borders:
$velocityPortletPreferences.setValue("portlet-setup-show-borders", "false")
$theme.runtime("56_INSTANCE_qyqy", "", $velocityPortletPreferences.toString())


Cheers,
Erik
vcvijayan MCA, módosítva 14 év-val korábban

RE: Adding portlet to a theme

thumbnail
Amira princesse, módosítva 13 év-val korábban

RE: Adding portlet to a theme

New Member Bejegyzések: 7 Csatlakozás dátuma: 2010.01.04. Legújabb bejegyzések
hello evry body,

i've created a custom search portlet that I wish to includ in the top of the theme.


this is the VM code

<div class="search_input">

#set ($myPlaceURL = $portletURLFactory.create($request, "customsearch_WAR_CustomSearchportlet_INSTANCE_abcd", $getterUtil.getLong($plid), "RENDER_PHASE"))

${myPlaceURL.setWindowState("maximized")}
${myPlaceURL.setPortletMode("view")}
${myPlaceURL.setParameter("javax.portlet.action", "doSearch")}

<form action="${myPlaceURL.toString()}" method="post" id="customsearch_WAR_CustomSearchportlet_INSTANCE_abcd_fm">  
	<input type="text" name="customsearch_WAR_CustomSearchportlet_INSTANCE_abcd_search" id="customsearch_WAR_CustomSearchportlet_INSTANCE_abcd_search">
	<input type="submit" value="Search">  
		
</form>	


</div>



and when click on the search buttom of my portlet I get :

You do not have the roles required to access this portlet.


note : i do not get any exceptio in my log

could any of you help me plz

Regards,
Amira
thumbnail
Brian Scott Schupbach, módosítva 12 év-val korábban

RE: Adding portlet to a theme

Expert Bejegyzések: 329 Csatlakozás dátuma: 2008.10.23. Legújabb bejegyzések
I'm also getting the "you do not have the required roles to access this portlet" error. Its weird because I'm logged in as the administrator and should have access to everything. Any ideas?
Jesse Paria, módosítva 12 év-val korábban

RE: Adding portlet to a theme

Junior Member Bejegyzések: 69 Csatlakozás dátuma: 2011.03.04. Legújabb bejegyzések
Not sure about this but I think if you go into the control panel and select plugins configuration and then select portlet plugins. You can add and edit the roles for that plugin. Perhaps you don't have administrator role applied to that plugin. Seems strange but I suppose it is possible.
The other thing to check is what roles you have specified in the portlet itselt in the portlet.xml file.

Hope this helps
thumbnail
Tariqul Islam, módosítva 9 év-val korábban

RE: Adding portlet to a theme

New Member Bejegyzések: 15 Csatlakozás dátuma: 2013.01.27. Legújabb bejegyzések
Yes possible please follow the bellow link.
http://tariqliferay.blogspot.com/2015/02/how-to-add-portlet-in-liferay-theme.html