plonegenericsetup

How would one set the default view of content that is imported via Generic Setup (structure)


I already know how to programatically set the default view content, in my specific case, a Folder, or how to use the Plone UI to do it. In my case, I am creating a large skeleton of content via GenericSetup and I need a set of folders to have a specific content item in each folder be the default view.

So, I have a folder structure like so:

folder1/
-- .properties
-- page1
-- homepage1
folder2/
-- .properties
-- page2
-- homepage2

I would think that in:

profile/default/structure/folder1/.properties 

you would be able to add:

DefaultView = homepage1

or similar. So the question is: "Is it possible to set the default view of a content item using Generic Setup?"

This answer might also work; I haven't tried it yet because I'd like some feedback on my question before moving away from GS to using ZCML.

How to define default views in Plone


Solution

  • The GS structure importer doesn't support this; it has no idea about the (Plone specific) Dynamic Layout support.

    You'll have to write your own custom GS step to do this, I am afraid, or perhaps use something like plone.app.transmogrifier (it includes support for browser defaults and collective.transmogrifier includes a GS step) to configure this.