Contents
Dynamic views are views which the content editor can choose for his/her content from Display... drop down menu in the green edit frame.
By default, Plone comes with dynamic views for
Dynamic view can be skins template or BrowserView. Dynamic view machinery only cares about the path name coming after the context object.
Products.CMFDynamicViewFTI.browserdefault.BrowserDefaultMixin.getAvailableLayouts() returns the list of known layouts like following:
[('folder_summary_view', 'Summary view'),
('folder_tabular_view', 'Tabular view'),
('atct_album_view', 'Thumbnail view'),
('folder_listing', 'Standard view'),
('product_listing', u'Product listing')]
layout_ids = [ id for id, title in self.portal.folder.getAvailableLayouts() ]
self.assertTrue("product_list" in layout_ids)
Note
Need code example.
self.portal.folder.setLayout("product_listing")
Default page is the content chosen to display when the visitor arrives to URL without any subpages or views selected.
This is useful if you are doing folder listing manually and you want to filter out the default view.
default_page helper view can be used to manipulate default pages.
Getting default page
# Filter out default content
container = self.getListingContainer()
default_page_helper = getMultiAdapter((container, self.request), name='default_page')
# Return content object which is the default page or None if not set
default_page = default_page_helper.getDefaultPage(container)
Setting default page can be done as simple as setting default_page attribute of the folder to be the id of the default page:
folder.default_page = "my_content_id"
More information can be found in