本文整理匯總了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': '',