本文整理汇总了Python中Products.CMFDynamicViewFTI.interfaces.ISelectableBrowserDefault.getDefaultPage方法的典型用法代码示例。如果您正苦于以下问题:Python ISelectableBrowserDefault.getDefaultPage方法的具体用法?Python ISelectableBrowserDefault.getDefaultPage怎么用?Python ISelectableBrowserDefault.getDefaultPage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Products.CMFDynamicViewFTI.interfaces.ISelectableBrowserDefault
的用法示例。
在下文中一共展示了ISelectableBrowserDefault.getDefaultPage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getMenuItems
# 需要导入模块: from Products.CMFDynamicViewFTI.interfaces import ISelectableBrowserDefault [as 别名]
# 或者: from Products.CMFDynamicViewFTI.interfaces.ISelectableBrowserDefault import getDefaultPage [as 别名]
#.........这里部分代码省略.........
'description': '',
'action': None,
'selected': True,
'icon': None,
'extra': {
'id': 'folderDefaultPageDisplay',
'separator': 'actionSeparator',
'class': 'actionMenuSelected'},
'submenu': None,
})
# Let the user change the selection
if folderCanSetDefaultPage:
results.append({
'title': _(u'label_change_default_item',
default=u'Change content item as default '
u'view...'),
'description': _(u'title_change_default_view_item',
default=u'Change the item used as default'
u' view in this folder'),
'action': '%s/select_default_page' % (folderUrl,),
'selected': False,
'icon': None,
'extra': {
'id': 'folderChangeDefaultPage',
'separator': 'actionSeparator',
'class': 'pat-plone-modal'},
'submenu': None,
})
# 2. Render context options
if context is not None:
contextUrl = obj.absolute_url()
selected = context.getLayout()
defaultPage = context.getDefaultPage()
layouts = context.getAvailableLayouts()
if useSeparators:
results.append({
'title': _(u'label_current_item_views',
default=u'Item display'),
'description': '',
'action': None,
'selected': False,
'icon': None,
'extra': {
'id': 'contextHeader',
'separator': 'actionSeparator',
'class': ''},
'submenu': None,
})
# If context is a default-page in a folder, that folder's views
# will be shown. Only show context views if there are any to show.
showLayouts = False
if not isDefaultPage:
showLayouts = True
elif len(layouts) > 1:
showLayouts = True
if showLayouts and contextCanSetLayout:
for id, title in contextLayouts:
is_selected = (defaultPage is None and id == selected)
results.append({
'title': title,
'description': '',