NOTE: For the dynamically extensible keyword list ZMS from version 2.0 beta is required.

Solution: Basic approach is to use for select/multiselect-attribute instead of fix (monolingual) key lists special objects as sources for the keys.

Example: Manually extensible keyword list for ZMS standard objects

First a special object of type Data Table is to be applied in the configuration menu that shall record the keyword list. This object must have a characteristic "records", a key ("key") as well as the corresponding value (e.g. "value") or in case of a multilingual solution values for the different languages (e.g. "value_ger" and "value_eng").

For example:

Spezielles Object 'Schlagwortliste'


This object now is integrated within the ZMS tree structure into a document that is set on type "Resource" so that it is accessible via the editorial interface only.

Then an internal link to the data table is inserted in the configuration menu below meta data containing the manually extensible keyword list. Type is to be set on "multiselect" or "select".

For example:

Metadaten


All keywords enlisted in the data table "keyword list" now appear in the characteristics of the selected objects. In the given example in all documents, folders and at the www-site.

To use the dynamic keyword list in a special object it can be referred to the corresponding meta-data and the data table:

Integration der dynamischen Schlagwortliste in ein Spezielles Objekt

All meta-data created in the configuration menu automatically appear in the head of each HTML page they are dedicated to. If access from another location to the values in the data table is wanted, this is possible as well. In the following example a keyword list is created by means of the function dict_list from the meta attribute "DC.Subject" that receives the meta name "keyword" since not all search engines cope with the DC conventions.

If this keyword list shall be contained in all documents, the following code is to be inserted in a template "headMeta_Spec" which is placed in the template directory of the ZMS instance.

<dtml-let metadictAttr="getMetadictAttr('attr_dc_subject')"
          metadictValue="getObjProperty('attr_dc_subject',REQUEST)"
          ob="getLinkObj(metadictAttr['keys'][0],REQUEST)">
          
  <dtml-call "REQUEST.set('dict',[])">
  <dtml-in "ob.getObjProperty('records',REQUEST)">
    <dtml-let x=sequence-item>
      <dtml-call 
       "dict.extend([x['key'],x.get('value',x.get('value_%s'%lang))])">
    </dtml-let>
  </dtml-in>
  <dtml-call "REQUEST.set('dict',dict_list(dict))">
  <dtml-try>
    <meta name="keywords" content="
    <dtml-in metadictValue>
      <dtml-var "dict.get(_['sequence-item'],'')" html_quote>
      <dtml-unless sequence-end>; </dtml-unless>
    </dtml-in>" />
  <dtml-except>
    <meta name="keywords" content="<dtml-var "dict.get(metadictValue,'')" 
     html_quote>" />
  </dtml-try>
</dtml-let>

API reference

Erstellt von: Silke Ebel , erstellt am:  2008/06/27 , zuletzt geändert: 2008/07/21