[Hippo-cms7-user BETA] Fields with predefined values
Frank van Lankvelt
f.vanlankvelt at onehippo.com
Tue Oct 7 11:48:05 CEST 2008
Defining predefined values is not yet possible. As this is in JCR, this
is certainly something we should do at some point!
The most flexible dropdown I can think of would show a list of nodes as
categories. These categories would best be documents themselves. While
it certainly is possible to store categories differently, I think making
them documents is the easiest way of getting the most out of your CMS.
(workflow, queries, facetselects)
The "list" type you're imagining is (a variant of) the
"hippostd:folder"/"hippostd:directory" type. These types are documents
themselves, i.e. it is possible to create a workflow on them. (in fact,
this is how folder operations work) Note that it is not possible to
have multiple variants of a folder, so if you want to have a publication
workflow on, say, the README field you will have to create a separate
(regular) document type (niels:categorylist?). The categories can then
be facetlinks in this type.
There are two obvious methods of storing the categories in the blog
- In the first, the blog entry type would be enriched with a facetlink.
Then the dropdown would consist of a query for all docs of that type and
selecting one of them would create the link. (it might be hard to
create useful urls with the hst this way; this is left as an exercise
for the reader)
- The other option that seems more appropriate for tagging-like
functionality is to store the name of the category as a string in a
special property. The list would still consist of (names of) nodes that
are found by a query. Constructing urls seems trivial here, with a
well-chosen facetsearch. Downside here is that the references are
terribly weak, so there won't be any out-of-the-box support for deleting
Hope this helps,
f.vanlankvelt at onehippo.com www.onehippo.com
Amsterdam Hippo B.V. Oosteinde 11 1017 WT Amsterdam
San Francisco Hippo USA Inc. 101 H Street, suite Q Petaluma CA
> -----Original Message-----
> From: hippo-cms7-user-bounces at lists.onehippo.com
> [mailto:hippo-cms7-user-bounces at lists.onehippo.com] On Behalf
> Of Niels van Kampenhout
> Sent: Monday, October 06, 2008 10:58 PM
> To: Hippo CMS7 user list
> Subject: [Hippo-cms7-user BETA] Fields with predefined values
> Is it possible to add a field with predefined values to a
> document type?
> For example, a dropdown field "sex" with possible values
> "male" and "female".
> And as a next step, I would like to get the possible values
> from the repository. For example, suppose I have a blog. I
> want to have categories for my posts. So in my 'blog post'
> document type, I want a dropdown with available categories.
> The categories I want to manage in a separate document of
> type 'list' (or maybe they are nodes in the JCR tree which I
> manage through some custom CMS plugin, who knows!).
> Any ideas on how this might be achieved?
> Hippo-cms7-user mailing list
> Hippo-cms7-user at lists.hippo.nl
More information about the Hippo-cms7-user