[Zope3-Users] Tales slot-fill'ing order

Frank Burkhardt fbo2 at gmx.net
Mon Apr 3 09:32:29 EDT 2006


Hi,

one of my objects has to add a list of keywords as <meta>-tag to the html-<head>.

The keyword list is dynamically created during fill-slot of the body. The template
looks like this:

<div metal:use-macro="context/@@standard_macros/page">

	<div metal:fill-slot="body" tal:omit-tag="">
		<tal:block tal:content="context/text/mpgsite:show" />
	</div>

	<meta metal:fill-slot="keywords" name="keywords"
		tal:attributes="content context/mpgsite:getKeyWords" />
</div>

The tales namespace-adapter 'mpgsite' is responsible for maintining a list of keywords
which are extracted from a string (mpgsite:show) and which are returned as a list
(mpgsite:getKeyWords).

Unfortunately, the fill-slot="keywords" is processed *before* fill-slot="body" (*) which
means that "context/text/mpgsite:show" is processed after "context/mpgsite:getKeyWords"
which eventually means that my keyword meta tag is empty.

(*) This is perfectly good from metal's point of view because define-slot="keywords" is
located in the html-head and define-slot="body" is in the body.

Does anyone know a solution for this problem?

Regards,

Frank


More information about the Zope3-users mailing list