Question

I am adding a sitemap portlet at the footer of my theme, and when I instance it I set the preferences for the root layout id, display depth and show hidden pages. My portal-normal.vm snippet:

#* Sitemap for the Footer Links *#
    #set ($portlet_id = '85')
    #set ($instance_id = 'AAAC')
#* Preferences *#
    #set ($rootLayoutId = "f74bd692-715f-4532-8490-dee211bebed8")
    #set ($displayDepth = 0)
    #set ($showHiddenPages = true)
    #set ($myPortletId = "${portlet_id}_INSTANCE_${instance_id}")
    $velocityPortletPreferences.setValue('portlet-setup-show-borders', 'false')
    $velocityPortletPreferences.setValue('rootLayoutId', 'f74bd692-715f-4532-8490-dee211bebed8')
    $velocityPortletPreferences.setValue('displayDepth', '0')
    $velocityPortletPreferences.setValue('showHiddenPages', 'false')
$theme.runtime($myPortletId, '', $velocityPortletPreferences.toString())
#set ($VOID = $velocityPortletPreferences.reset())

But the portlet is displayed with the basic preferences. Haven't found info about preferences names/values, so any help would be appreciated. Thanks.

EDIT with the solution Following @Pankaj Kathiriya indication i wrote next code that is correctly working:

#* Sitemap for the Footer Links *#
    #set ($portlet_id = '85')
    #set ($instance_id = 'AABB')
#* Instanciate the portlet *#
    #set ($myPortletId = "${portlet_id}_INSTANCE_${instance_id}")
    $velocityPortletPreferences.setValue('portlet-setup-show-borders', 'false')
    $velocityPortletPreferences.setValue('rootLayoutUuid', 'f74bd692-715f-4532-8490-dee211bebed8')
    $velocityPortletPreferences.setValue('displayDepth', '0')
    $velocityPortletPreferences.setValue('showHiddenPages', 'true')
    $theme.runtime($myPortletId, '', $velocityPortletPreferences.toString())
#* Reset preferences *#
    $velocityPortletPreferences.reset()
Was it helpful?

Solution

Problem is at line below:

 $velocityPortletPreferences.setValue('rootLayoutId', 'f74bd692-715f-4532-8490-dee211bebed8')

It should be

$velocityPortletPreferences.setValue('rootLayoutUuid', 'f74bd692-715f-4532-8490-dee211bebed8')

It should be rootLayoutUuid

Regards

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top