Parent-child relationship of documents

34 views
Skip to first unread message

Manik Magar

unread,
Apr 6, 2017, 11:13:45 PM4/6/17
to Hippo Community
I am trying to use Selection component to add dropdowns that should list all documents of certain document types. For example, I am creating a new Document Type 'Category'. Now on category, I want to a dropdown field 'Parent Category' that which will list all existing categories. How to make Dropdown populate all documents? Thanks.

Jeroen Hoffman

unread,
Apr 7, 2017, 8:09:11 AM4/7/17
to hippo-c...@googlegroups.com
Hi,
The idea here is to
- create a CMS service that implements "org.onehippo.forge.selection.frontend.provider.IValueListProvider" and does a
JCR query for those category documents
- configure that service besides /hippo:configuration/hippo:frontend/cms/cms-services/DocumentValueListProvider, giving
it a custom id in valuelist.provider property
- reference it in your document field at
/hippo:namespaces/yournamespace/yourdocumenteditor:templates/_default_/yourfield/cluster.options/valuelistProvider

The valuelistProvider it also mentioned at https://www.onehippo.org/library/concepts/plugins/selections/configuration.html
For inspiration, you can have a look at org.onehippo.forge.selectiondemo.provider.CustomValueListProvider in the demo in
our code base at https://code.onehippo.org/cms-community/hippo-plugin-selections

HTH!
Jeroen
> --
> Hippo Community Group: The place for all discussions and announcements about Hippo CMS (and HST, repository etc. etc.)
>
> To post to this group, send email to hippo-c...@googlegroups.com
> RSS: https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
> ---
> You received this message because you are subscribed to the Google Groups "Hippo Community" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
> hippo-communi...@googlegroups.com <mailto:hippo-communi...@googlegroups.com>.
> Visit this group at https://groups.google.com/group/hippo-community.
> For more options, visit https://groups.google.com/d/optout.

Manik Magar

unread,
Apr 7, 2017, 9:51:10 PM4/7/17
to Hippo Community
Thank you Jeroen. I am new to Hippo CMS and evaluation it. I will give it a try. Is there a reason, there is not a generic list provider in the selection plugin that allows to set the document type to pull documents? It seems to be a very a common use case.

Regards,
Manik.

Reply all
Reply to author
Forward
0 new messages