metal: how to get a portlet to render in a plone page template
Hi. This is a plone question, but i've not been able to find an answer on the Plone list so far: I am trying to embed the portlet news macro on Plones index_html top level page template. This should render the news within the template, but does not: <h2>News Summary</h2> <div metal:block metal:use- macro="python:path('here/portlet_news/macros/portlet')" /> Summary of news items goes here. </div> Does anyone have a suggestion as to how to get this portlet to render in the page template? Harlow Pinson Indepth Learning Email: hpinson@indepthl.com Web: http://www.indepthl.com Voice: 505-994-2135 FAX: 208-475-7678
hpinson@indepthl.com wrote:
Hi. This is a plone question, but i've not been able to find an answer on the Plone list so far:
I am trying to embed the portlet news macro on Plones index_html top level page template. This should render the news within the template, but does not:
<h2>News Summary</h2> <div metal:block metal:use- macro="python:path('here/portlet_news/macros/portlet')" /> Summary of news items goes here. </div>
Does anyone have a suggestion as to how to get this portlet to render in the page template?
Harlow Pinson Indepth Learning Email: hpinson@indepthl.com Web: http://www.indepthl.com Voice: 505-994-2135 FAX: 208-475-7678
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
do you have any published news that could be rendered. The portlest does only show published news. robert
do you have any published news that could be rendered. The portlest does only show published news.
Yes, all news is published. The portlet <h5> title and border do not render either. In fact, I am beginning to wonder if the Plone default index_html is a page template at all. I cannot even get the following simple snippet to render: The URL is <span tal:replace="request/URL">URL</span>. The document object type seems something called "Dublin Core". I have tried to replace the top level index_html with a page template, but that just generates errors. Harlow Pinson Indepth Learning Email: hpinson@indepthl.com Web: http://www.indepthl.com Voice: 505-994-2135 FAX: 208-475-7678
On Tuesday 06 April 2004 04:22 pm, hpinson@indepthl.com wrote:
do you have any published news that could be rendered. The portlest does only show published news.
Yes, all news is published. The portlet <h5> title and border do not render either.
In fact, I am beginning to wonder if the Plone default index_html is a page template at all. I cannot even get the following simple snippet to render:
It is not, it is a CMF Document. It is not dynamic in any way. You could delete it from the ZMI and add a page template in its place if that is what you want. Make sure to include the appropriate macros.
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. Harlow Pinson Indepth Learning Email: hpinson@indepthl.com Web: http://www.indepthl.com Voice: 505-994-2135 FAX: 208-475-7678
hpinson@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?
I have collected a few ZPT links on my Web site: <http://www.webproducer.at/Members/tonico/News/zpt_documentation> Tonico
On Thursday 08 April 2004 10:59 am, hpinson@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
Yes, that makes sense. I copied the news template as a model, and renamed it index_html, moving it to the top level directory. Stripped it down to pretty much what you suggest. When I get an example really working I will post it to the list. Thanks for your suggestion-- it sparked my mind and I understand a little better how plone works now. Harlow Pinson Indepth Learning Email: hpinson@indepthl.com Web: http://www.indepthl.com Voice: 505-994-2135 FAX: 208-475-7678
On Friday, April 9, 2004, at 04:10 AM, Alec Mitchell wrote:
On Thursday 08 April 2004 10:59 am, hpinson@indepthl.com wrote:
My goal is to embed two portlets (New and Events) as content in the site home page.
you might want to take a look at CMFContentPanels - makes it easy to build a page full of portlets and whatnot.
hpinson@indepthl.com wrote:
Hi. This is a plone question, but i've not been able to find an answer on the Plone list so far:
Have you tried the plone-design list?
I am trying to embed the portlet news macro on Plones index_html top level page template. This should render the news within the template, but does not:
<h2>News Summary</h2> <div metal:block metal:use- macro="python:path('here/portlet_news/macros/portlet')" /> Summary of news items goes here. </div>
Does anyone have a suggestion as to how to get this portlet to render in the page template?
Do you get any errors? What's the name of the parent macro and which slot are you trying to fill? Tonico
participants (5)
-
Alec Mitchell -
hpinson@indepthl.com -
Marc Lindahl -
robert rottermann -
Tonico Strasser