Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to define default views in Plone

Tags:

plone

I have already a page template for the default view of a Plone site (main page). How to define the default view of a folder? This default view should use a page template.

like image 497
HelioAraujo Avatar asked Dec 06 '22 17:12

HelioAraujo


2 Answers

Try this:

  • navigate to the desired folder
  • add "/manage_propertiesForm" at the end of the url
  • in the resulting form add this property:
    • name: "layout"
    • type: "string"
    • value: the page template name without extension
like image 121
Giacomo Spettoli Avatar answered Jun 14 '23 02:06

Giacomo Spettoli


Use the answers above if you want to set one of the default views (tabular, thumbnail, etc), but if you want to choose a particular content item for the default view of the folder, you can do it in the ZMI as suggested:

  • navigate to the desired folder
  • add "/manage_propertiesForm" at the end of the url
  • in the resulting form add this property:
    • name: "default_page"
    • type: "string"
    • value: the id of the content item

or do it programmatically in Python:

content_id = "Name of the Content Item"
folder.manage_addProperty('default_page', content_id, 'string')

Hope this helps!

like image 33
Spanky Avatar answered Jun 14 '23 01:06

Spanky