Skip to content

Commit

Permalink
Merge pull request #208 from plone/fix_default_page_types_in_folder_c…
Browse files Browse the repository at this point in the history
…ontents

Pass default_page_types to allow respecting that in folder_contents
  • Loading branch information
pbauer authored Jul 31, 2020
2 parents 3ff4be3 + d484bb8 commit dbecd6f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions news/147.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Pass default_page_types to allow respecting default_pages_types.
[pbauer]
5 changes: 5 additions & 0 deletions plone/app/content/browser/contents/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,10 @@ def get_thumb_scale(self):
thumb_scale_table = settings.thumb_scale_table
return thumb_scale_table

def default_page_types(self):
registry = getUtility(IRegistry)
return registry.get('plone.default_page_types', [])

@property
def ignored_indexes(self):
ignored = [
Expand Down Expand Up @@ -291,6 +295,7 @@ def get_options(self):
'indexOptionsUrl': '%s/@@qsOptions' % base_url,
'contextInfoUrl': '%s{path}/@@fc-contextInfo' % base_url,
'setDefaultPageUrl': '%s{path}/@@fc-setDefaultPage' % base_url,
'defaultPageTypes': self.default_page_types(),
'searchParam': 'Title',
'availableColumns': columns,
'attributes': ['Title', 'path', 'getURL', 'getIcon', 'getMimeIcon', 'portal_type'] + list(columns.keys()), # noqa
Expand Down

0 comments on commit dbecd6f

Please sign in to comment.