[Zope-CMF] Extra field on metadata form
Tres Seaver
tseaver@zope.com
01 Mar 2003 10:15:44 -0500
On Sat, 2003-03-01 at 08:54, David Cain wrote:
> When I create a new object and are asked on the Standard Resource
> Metadata form to enter my metadata, there is a empty drop-down below the
> "Subject" text input box.
>
> What is it for?
The template is at:
Products/CMFDefault/skins/zpt_content/metadata_edit_form. It defines
that cell as:
<td tal:define="subj_lines python: modules['string'].join(
here.subjectsList(), '\n' )">
<textarea name="subject:lines" rows="3" cols="20"
tal:content="subj_lines"></textarea>
<br>
<select name="subject:list" multiple>
<option value=""
tal:define="
items python:
here.portal_metadata.listAllowedSubjects(
here);
subjects here/Subject;
"
tal:repeat="item items"
tal:attributes="value item;
selected python: item in subjects"
tal:content="item">
</option>
</select>
</td>
Note that both the textarea and the listbox have the name, 'subject'.
The listbox is populated from a query to the 'portal_metadata' tool
for the "allowed" values for Subject for the current object.
When customizing this skin, some people will remove the textarea,
to ensure that the Subject values all come from a controlled vocabulary.
Others might remove the listbox, because they don't need such
restrictions. The template used to have comments to that effect; they
got dropped during some cleanup effort, IIRC.
Tres.
--
===============================================================
Tres Seaver tseaver@zope.com
Zope Corporation "Zope Dealers" http://www.zope.com