howto access the metadata of an index doc

Joachim Schmitz <[email protected]>
Newsgroups gmane.comp.web.zope.silva.devel
Message-ID <[email protected]>
that was  "what to do, to use a new meta-data-set ?"

I created a new meta-data-set with Namespace URI: 
http://infrae.com/namespaces/metadata/zwec, and Namespace Prefix: 
"zwec", added two fields to it, and activated it. I edited the
Content Type Metadata Mapping for a Silva Document Version to 
"silva-content, silva-extra, zwec"

After that the new metadata-set shows in the properties for each silva 
document version. I can edit the new metadata.

I tried this in the index document of a publication. The snipplet in my 
content.html.pt looks like this:

<tr metal:fill-slot="main"
    tal:define="view_method options/view_method"
   border="0" cellpadding="0" cellspacing="0" style="width:768px">
<td colspan=1 class="ccc"
	  tal:attributes="colspan python: 
model.get_metadata_element('zwec','grid_width');
	  class python: model.get_metadata_element('zwec','css_class')"
tal:content="structure python:getattr(model, view_method)()">
</td>
</tr>

this fails cause the model is the publication not the index.pt, the 
publication has no metadata set "zwec". If I write:
tal:attributes="colspan python: 
model.index.get_metadata_element('zwec','grid_width')"

it works for index, but not for all other docs.

So the question is how do I get the actuall published document in this 
case ?

-- 
Mit freundlichen Grüßen                                Joachim Schmitz
......................................................................
AixtraWare eK ..Joachim Schmitz ..www.aixtraware.de ..t: +49-2464-8851
Hüsgenstr. 33a .....d-52457 Aldenhoven .............f: +49-2464-905163
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.