Patrick CHAILLOUX wrote:
> I'm trying to force a contentbox to list documents using some local
> metadata vocabulary ('Local Vocabularies Container' under CPS).
> I have some trouble accessing the local vocabulary in
> "contentbox_edit_form".
>
> 'Themes' is a property of my documents' metadata. It uses a local
> vocabulary.
> I tried to recycle some code used in the "advanced search form" but of
> course it's using the locale 'here'.
>
> <tr> <b>Choose some themes</b>
>
> <select size="5" name="Themes:list" multiple="multiple"
> tal:define="themes_set python:request.get('Themes', ());
> all_themes python:here.getListFromVocabulary('themes_voc')">
> <option value="" tal:attributes="selected not:themes_set"
> i18n:translate="label_all">All</option>
> <option tal:repeat="item all_themes/items"
> tal:attributes="value python:item[0];
> selected python:item[0] in themes_set or
> None"
> tal:content="python:item[1]"
> i18n:translate=""></option>
> </select>
>
> </tr>
>
> I need this chunk to use as context the folder I have chosen in
> 'contentbox_edit_form.' .
> I tried modifying this to :
> all_themes
> python:box['box'].getListFromVocabulary('themes_voc')">
>
> but it still lists the global vocabulary.
yup because the content box instance should *not* be defined locally in
this case but at the root of the instance. If you want to find you local
vocabulary container through acquisition you certainly need to call the
getListFromVocabulary() method on on of the item instance instead unless
there's a variable within the context of the boxes which represents the
actual context in which the user is navigating which I doubt... This is
something that do exist with the portlets nowadays.
J.
--
Julien Anguenot | Nuxeo R&D (Paris, France)
Open Source ECM - www.nuxeo.com
CPS Platform - http://www.cps-project.org
Mobile: +33 (0) 6 72 57 57 66
signature.asc
Description: OpenPGP digital signature
_______________________________________________ cps-devel mailing list http://lists.nuxeo.com/mailman/listinfo/cps-devel
