Fórumok
Using runtime portlet tag in wcm template
Thomas Berg, módosítva 9 év-val korábban
Using runtime portlet tag in wcm template
Regular Member Bejegyzések: 131 Csatlakozás dátuma: 2009.09.07. Legújabb bejegyzések
Hi,
EDIT: Forgot to mention which version I'm using: Liferay 6.2.1 CE GA2
I've been trying the example by Barrie Selack:
http://www.liferay.com/web/barrie.selack/blog/-/blogs/embedding-a-portlet-in-web-content
The basic examples are working fine but I need to set some default preferences and cannot get it to work:
(47 is the "Welcome Portlet")
I have also tried using
and
But to no avail!
Anyone tried this and know if I'm doing something wrong?
Regards Thomas
EDIT: Forgot to mention which version I'm using: Liferay 6.2.1 CE GA2
I've been trying the example by Barrie Selack:
http://www.liferay.com/web/barrie.selack/blog/-/blogs/embedding-a-portlet-in-web-content
The basic examples are working fine but I need to set some default preferences and cannot get it to work:
(47 is the "Welcome Portlet")
#set ($defaultPrefs = "
<portlet-preferences>
<preference>
<name>portletSetupShowBorders</name>
<value>false</value>
</preference>
</portlet-preferences>
")
<runtime-portlet name="47" instance="$article-reserved-id.data" defaultPreferences="$escapeTool.xml($defaultPrefs)" />
I have also tried using
<runtime-portlet name="47" instance="$article-reserved-id.data" defaultPreferences="portletSetupShowBorders=false" />
and
<runtime-portlet name="47" instance="$article-reserved-id.data" queryString="portletSetupShowBorders=false" />
But to no avail!
Anyone tried this and know if I'm doing something wrong?
Regards Thomas
Mario R, módosítva 8 év-val korábban
RE: Using runtime portlet tag in wcm template
Junior Member Bejegyzések: 55 Csatlakozás dátuma: 2013.06.06. Legújabb bejegyzések
Hi!
I have the same problem!!
Some ideas?
I tried different approaches:
Using portlet-setup-show-borders
Using the portletSetupShowBorders
The two firsts approaches return the error: The value of attribute defaultPreferences associated with an element type runtime-portlet must not contain the '<' character.
Using manually string escape:
Using this approach no errors are generated, but the preference isn't applied!
Atte:
Mario
I have the same problem!!
Some ideas?
I tried different approaches:
Using portlet-setup-show-borders
#set($preferences = $stringUtil.insert("<portlet-preferences>", "<preference>", 9999))
#set($preferences = $stringUtil.insert($preferences, "<name>portlet-setup-show-borders</name>", 9999))
#set($preferences = $stringUtil.insert($preferences, "<value>false</value>", 9999))
#set($preferences = $stringUtil.insert($preferences, "</preference>", 9999))
#set($preferences = $stringUtil.insert($preferences, "</portlet-preferences>", 9999))
Using the portletSetupShowBorders
#set($preferences = $stringUtil.insert("<portlet-preferences>", "<preference>", 9999))
#set($preferences = $stringUtil.insert($preferences, "<name>portletSetupShowBorders</name>", 9999))
#set($preferences = $stringUtil.insert($preferences, "<value>false</value>", 9999))
#set($preferences = $stringUtil.insert($preferences, "</preference>", 9999))
#set($preferences = $stringUtil.insert($preferences, "</portlet-preferences>", 9999))
The two firsts approaches return the error: The value of attribute defaultPreferences associated with an element type runtime-portlet must not contain the '<' character.
Using manually string escape:
#set($preferencias = $stringUtil.insert("<portlet-preferences>", "<preference>", 9999))
#set($preferencias = $stringUtil.insert($preferencias, "<name>portlet-setup-show-borders</name>", 9999))
#set($preferencias = $stringUtil.insert($preferencias, "<value>false</value>", 9999))
#set($preferencias = $stringUtil.insert($preferencias, "</preference>", 9999))
#set($preferencias = $stringUtil.insert($preferencias, "</portlet-preferences>", 9999))
Using this approach no errors are generated, but the preference isn't applied!
<runtime-portlet name="73" instance="" queryString="" defaultPreferences="$preferences" />
Atte:
Mario