[Zope] metal: how to get a portlet to render in the default index_html

Alec Mitchell apm13 at columbia.edu
Thu Apr 8 22:10:26 EDT 2004


On Thursday 08 April 2004 10:59 am, hpinson at indepthl.com wrote:
> Hi Alec.  Yes you are right. I see now that the default index_html
> document is a CMF document and is not dynamic at all.  This is why I
> cannot call portlets from it.
>
> I did as you suggested and replaced the top-level index_html document
> with a page template.  That works, but now the plone interface is
> completely gone.
>
> You mentioned "Make sure to include the appropriate macros." in the
> new page tempate  Can you, or someone else elaborate on how to do
> this?
>
> My goal is to embed two portlets (New and Events) as content in the
> site home page.

Go into portal_skins/plone_templates/ and look at e.g. folder_contents or any 
number of others.  The gist of it is you need to call the master macro of the 
main_template like this (Plone 2, not sure if this is entirely correct for 
earlier versions):

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"
      lang="en-US"
      i18n:domain="plone"
      metal:use-macro="here/main_template/macros/master">

  <div metal:fill-slot="main">
      Whatever you want goes here
  </div>

</html>

Hope that helps,
Alec Mitchell



More information about the Zope mailing list