Foren

How to configure theme embedded SiteMap with custom ADT for all pages?

thumbnail
Fernando Fernandez, geändert vor 7 Jahren.

How to configure theme embedded SiteMap with custom ADT for all pages?

Expert Beiträge: 396 Beitrittsdatum: 22.08.07 Neueste Beiträge
Hi all,

I've embedded the Site Map portlet in my theme's portal_normal.vm and it's working OK.

#set ($VOID = $velocityPortletPreferences.setValue('portletSetupShowBorders', 'false'))
$theme.runtime("85_INSTANCE_FOOTER", "", $velocityPortletPreferences.toString())
#set ($VOID = $velocityPortletPreferences.reset())


I then created an ADT to change the Site Map output and it's working also OK.

My problem is that the embedded portlet, in some pages, doesn't use the ADT. I have to manually configure the portlet in that page to use the ADT.

I've thought this might be caused by some records in the PortletPreferences table but I've checked and there's no records there about this config.

Any ideas?

TIA

Fernando
thumbnail
Travis Cory, geändert vor 7 Jahren.

RE: How to configure theme embedded SiteMap with custom ADT for all pages?

Junior Member Beiträge: 73 Beitrittsdatum: 04.06.13 Neueste Beiträge
Hi Fernando,

Are you importing the ADT with the theme via the resources importer? If so you may be able to do this in the same way you can set the ADT in the sitemap.json

"portletPreferences": {
	"displayStyle": "ddmTemplate_TEMPLATE-NAME-ALL-CAPS-NO-SPACES",
	"displayStyleGroupId": "${groupId}",
}


you can try setting in the portal_normal.vm using


#set ($VOID = $velocityPortletPreferences.setValue('displayStyle', 'ddmTemplate_TEMPLATE-NAME-ALL-CAPS-NO-SPACES'))
#set ($VOID = $velocityPortletPreferences.setValue('displayStyleGroupId', '$groupId'))
thumbnail
Fernando Fernandez, geändert vor 7 Jahren.

RE: How to configure theme embedded SiteMap with custom ADT for all pages?

Expert Beiträge: 396 Beitrittsdatum: 22.08.07 Neueste Beiträge
Hi Travis,

Thanks for your help. I'm not using resource-importer, just changing the theme template and the ADT is manually inserted.

I'm not able to make it work exactly like you wrote.

My template name is "SiteMapCust" and I tried

#set ($VOID = $velocityPortletPreferences.setValue('displayStyle', 'ddmTemplate_SITEMAPCUST'))


But it only worked with the id:


#set ($VOID = $velocityPortletPreferences.setValue('displayStyle', 'ddmTemplate_cbe3bd92-354f-41e9-ac6f-6ba1b09cf642'))


Although this works, it's not very practical, if you have to export/import the site.

Any ideas why the name doesn't work? Anything to do with language settings, perhaps?

Also, I had to change $groupId to $group_id.

Thanks

Fernando
thumbnail
Travis Cory, geändert vor 7 Jahren.

RE: How to configure theme embedded SiteMap with custom ADT for all pages?

Junior Member Beiträge: 73 Beitrittsdatum: 04.06.13 Neueste Beiträge
When creating the ADT through the UI, the id stored is random, which doesn't make it possible to export and import. I believe if you use the resources importer the ID is set to the name of the ADT itself.
thumbnail
Fernando Fernandez, geändert vor 7 Jahren.

RE: How to configure theme embedded SiteMap with custom ADT for all pages?

Expert Beiträge: 396 Beitrittsdatum: 22.08.07 Neueste Beiträge
Thanks Travis, I'll have to go and study the Resource Importer, then. :-)

Cheers

Fernando