Plone:如何对文件夹项目进行排序 [英] Plone: How to sort folder items
问题描述
我有一个名为myfolder
的文件夹,其中包含一些项目,例如:item1
,item2
,item3
等.
I have a folder called myfolder
, that has some items inside, like: item1
, item2
, item3
, and etc.
当我将portlet Navigation
添加到页面的左列,并输入到文件夹myfolder
时,它向我显示了portlet上的链接,如下所示:
When I added the portlet Navigation
to the left column of the page, and entered on the folder myfolder
, it showed me the links on the portlet like this:
- item1
- item2
- item3
我希望Navigation
portlet以这种精确的方式显示链接:
I want that the Navigation
portlet shows me links on this exact sort:
- item2
- item1
- item3
我知道我可以进入myfolder enter code here
的Content
选项卡,并将每个项目拖动到所需的位置.
但是使用这种方式,如果我在新的Plone Site
上重新安装所有产品,则会丢失配置.因此,我想在我的产品上配置此navigation order
,而不是仅在已安装的plone site
上进行配置,以便使此更改永久存在.
I know that I can go on the Content
tab of myfolderenter code here
, and drag each item to the position that I want.
But using this way, if I reinstall all my product on a new Plone Site
, I lost my configuration. So I want to have this navigation order
configured on my product, instead of only on a installed plone site
, so that this change stays forever.
我该怎么做?
推荐答案
已解决:我可以通过在产品安装下进行操作来解决此问题:
Solved: I could solve this by doing under the installation of the product:
#file: Extensions/Install.py
def install(portal):
#...another steps from install
portal = getToolByName(portal, 'portal_url')
portal = portal.getPortalObject()
portal.moveObjectsToTop(['item2', 'item1', 'item3', ])
portal.plone_utils.reindexOnReorder(portal)
就是这个.
这篇关于Plone:如何对文件夹项目进行排序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!