使用rference paragraph component
我可以通過瀏覽其路徑來顯示其他段落系統的內容。如何隱藏reference paragraph
的某個content/paths
?以附圖爲例,如何隱藏Products
? 如何隱藏參考段落組件中的路徑
2
A
回答
2
我希望我的回答是相關的。 所以要做到這一點,你需要:
- 創建謂詞篩選頁面顯示在對話框中。
- 創建自己的選擇頁面控件(立足於默認的)
- 創建自己的基準件(立足於默認的)
所以你的判斷可以是這樣的:
import com.day.cq.commons.predicate.AbstractNodePredicate;
import org.apache.commons.collections.Predicate;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Property;
import org.apache.felix.scr.annotations.Service;
import javax.jcr.Node;
import javax.jcr.RepositoryException;
@Component
@Service
@Property(name = "predicate.name", value = "myPredicate")
public class MyPredicate extends AbstractNodePredicate implements Predicate {
@Override
public boolean evaluate(final Node node) throws RepositoryException {
return node.isNodeType("nt:hierarchyNode")
&& !node.getPath().startsWith("/content/geometrixx/en/products");
}
}
行return node.isNodeType("nt:hierarchyNode")
取自CQ提供的另一個謂詞IsHierarchyNodePredicate
。我們添加了另一個聲明 - 按路徑過濾。
然後我們需要創建我們自己的小部件,我們將使用我們的謂詞。從ParagraphReference
- 重命名部件(CQ.form:要做到這一點,複製「/libs/cq/ui/widgets/source/widgets/form/ParagraphReference.js」到項目中,編輯完它在接下來的方式.ParagraphReference)到MyParagraphReference(CQ.form.MyParagraphReference)並將其註冊爲新的xtype - myparagraphreference。
- 將其添加到cq.widgets類別中,因此它將在作者模式下可用。
在這個文件中,你會發現下一個行:
var loader = new CQ.Ext.tree.TreeLoader({ "url": CQ.HTTP.externalize("/content.ext.json"), "requestMethod": "GET", "baseParams": { "predicate": "hierarchy", "depth": 0 }, "baseAttrs": { "iconCls": "page" } });
變化
"predicate": "hierarchy"
到"predicate": "myPredicate"
下一步將是我們的組件。將「/ libs/foundation/components/reference」組件複製到您的項目並編輯它的對話框 - 將參考節點的xtype更改爲「myparagraphreference」。
所以從這一刻起,您可以在夥伴中找到您的組件,並且不會有節點「產品」。
P.S:您也可以只覆蓋默認組件與一個和覆蓋默認小部件,而不是創造新的。
如果您有任何問題 - 請不要猶豫,問我。 祝你好運。
修訂
相關問題
- 1. 組組件參考路徑
- 2. jQuery,隱藏段落
- 3. 基於Vue中的路徑路徑或參數隱藏元素
- 4. 參考.properties文件中的類路徑
- 5. 只隱藏html段落中的文本
- 6. 如何隱藏真實的index.php路徑
- 7. 參考中沒有路徑
- 8. 如何隱藏段控件中的段?
- 9. 如何從Ant中的參考路徑中排除文件?
- 10. make的參考路徑
- 11. 從POST請求中隱藏php文件路徑和參數?
- 12. 如何隱藏PDF.js中的文件路徑
- 13. 如何隱藏URL中的文件路徑?
- 14. 如何隱藏Jw播放器中的文件路徑
- 15. 如何隱藏SD卡路徑名?
- 16. 如何隱藏實際路徑Carrierwave
- 17. 創建文件的隱藏路徑
- 18. 數組與參考文件的路徑打開文件
- 19. 如何在Texlipse項目中隱藏文件夾「搜索路徑」
- 20. vb6更改參考路徑
- 21. MSBuild - 設置參考路徑
- 22. 關於參考路徑
- 23. Cocoapod路徑參考錯誤
- 24. 設置.dll參考路徑
- 25. ASP.Net隱藏路徑MVC 4
- 26. 隱藏或加密文件路徑(src)
- 27. CSS文件輸入隱藏路徑
- 28. 什麼是vscode中的參考路徑
- 29. #javascript參考路徑中的#字符
- 30. 如何隱藏用戶使用php的下載文件路徑?
這工作得很好謝謝:) – Ronald 2014-11-04 06:42:31