使用XType浏览字段浏览时如何隐藏某些路径? [英] How to hide some paths while browsing using the XType browsefield?

查看:88
本文介绍了使用XType浏览字段浏览时如何隐藏某些路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在组件对话框中,我使用 browsefield XType使用户能够浏览页面树并选择页面:

In my component dialog, I use browsefield XType to enable the user to browse through the page tree and select a page:

<page jcr:primaryType="cq:Widget" 
      fieldLabel="Page"
      name="./path" 
      xtype="browsefield" />

同时,我想使某些页面不可见。假设我具有以下结构:

At the same time, I would like to make some pages are invisible. Suppose I have the following structure:

pages/
    page1/
        page1_1/
        page1_2/

如何制作 pages / page1 / page1_2 不可见,因此没人能在浏览页面树时选择它吗?

How do I make pages/page1/page1_2 invisible, so that nobody can select it when he browses through the page tree?

推荐答案

浏览字段 >是已弃用的xtype,它替换了 路径字段 具有此功能。 Pathfield具有一个名为 predicate 的属性,可用于过滤。您可以创建并注册一个自定义谓词,该谓词对于您不希望在对话框中显示的路径返回false。然后可以将自定义谓词的名称传递到pathfield的配置。

browsefield is a deprecated xtype, it's replacement the pathfield has this feature. Pathfield has a property called predicate which can be used for filtering. You can create and register a custom predicate that returns false for the paths you don't want to be visible in the the dialog. The name of the custom predicate can then be passed to the config of pathfield.

您可以在此处找到详细的教程: http://www.albertoalmagro.com/2013/05/adobe-cq5-create-predicate- pathfield.html

You can find a detailed tutorial on this here : http://www.albertoalmagro.com/2013/05/adobe-cq5-create-predicate-pathfield.html

有关谓词的更多信息,可以引用以下链接:

For more on predicates, the following links can be referred :

< a href = http://www.wemblog.com/2013/04/how-to-create-custom-query-predicate-in.html rel = nofollow> http://www.wemblog.com/ 2013/04 / how-to-create-custom-query-predicate-in.html

http://labs.sixdimensions.com/blog/ 2013-07-10 / custom-predicateevaluators-or-i-learned-stop-worry-and-love /

这篇关于使用XType浏览字段浏览时如何隐藏某些路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆