Thursday 17 February 2005 11:04:35 am
Here's the problem: I'd like to be able to embed both images and file links inside XML fields. Images should be displayed as block elements as in the default eZ Publish functionality -- wrapped in <div class="object-(align)"> tags. But embedded files I would like to display as inline, so that my users can just <a href="this is a normal link to a file">link to a file</a> in the normal flow of a sentence. I know I can override the embed.tpl embed template so that images and files use different embed templates -- that's easy. The problem is I need to override object.tpl (content/datatype/view/ezxmltags/object.tpl) -- the single template that determines how all objects are embedded in XML fields. But I need to override it based on the class, section or something of the <b>object being embedded</b> not the properties of the <b>object it's being embedded in</b> (which is article, for instance). I want object.tpl to work one way for images, another for files. Is there any way to do this? Or is there a workaround that would work? I've run into this problem before but have always been able to work around it by doing an override on some combination of class, section and attribute_identifier, but that won't work this time since all of these objects are being embedded in the same attribute (body text) of the same class (article) in the same section. Any ideas?
|