Hello
we are currently trying to create a custom contentPicker. The idea is to use the standard treepicker, but with our own set of data.
We've created a custom property editor, that has nearly the same properties than the multinode treepicker.
Everything works fine, but we want to subset the data that are displayed in the dialog : we have content with a property "show", and we want to display only the nodes that have this property set to true.
Any idea on how to filter the data displayed ?
Didier
Important to set the TreeUse = TreeUse.Dialogon the Tree attribute to prevent the tree displaying in sections. You only want it inside the picker dialog.
You can use the GetTreeNodes method to query your tree and filter on the 'show' property.
Then in the dialog that you're opening from your custom contentpicker controller you can add the umbraco tree directive, pointing to your custom TreeController.
Custom data for contentPicker
Hello we are currently trying to create a custom contentPicker. The idea is to use the standard treepicker, but with our own set of data. We've created a custom property editor, that has nearly the same properties than the multinode treepicker. Everything works fine, but we want to subset the data that are displayed in the dialog : we have content with a property "show", and we want to display only the nodes that have this property set to true. Any idea on how to filter the data displayed ? Didier
When you would like to go the fully custom way you could consider to create a class that inherits
TreeController
.See https://our.umbraco.com/documentation/extending/section-trees/trees
Important to set the
TreeUse = TreeUse.Dialog
on theTree
attribute to prevent the tree displaying in sections. You only want it inside the picker dialog.You can use the
GetTreeNodes
method to query your tree and filter on the 'show' property.Then in the dialog that you're opening from your custom contentpicker controller you can add the umbraco tree directive, pointing to your custom TreeController.
Other options is to make use of the https://our.umbraco.com/packages/backoffice-extensions/contentment/ package
Corné
Is the data outside of Umbraco or is it Umbraco nodes? Wondering if you could write an xpath that checks for your property if its the latter?
they are umbraco nodes
is working on a reply...