[GeneralDiscussion] Re: zope/plone article

[email protected] (Niall Douglas) Thu, 05 Mar 2009 06:59:08 -0800
Newsgroups gmane.comp.web.zope.zwiki
Message-ID <49AFE89B.15287.4872AD3__11434.2812019915$1236265370$gmane$org@s_sourceforge.nedprod.com>
This is actually working code for content.pt, but it seems awfully 
brute force (i.e. slow, CPU intensive and inefficient):

    <div metal:define-macro="content" class="content">
      <div tal:replace="structure 
python:here.talsafe(here.renderText(here.pageWithName('Masterinclude')
.read()+'\n\n'+here.read(),
                               
here.pageTypeId(),REQUEST=request,RESPONSE=request.RESPONSE))">
        content goes here..
      </div>
      <!-- <div tal:replace="structure 
python:here.talsafe(options['body'])">
        main text, subtopics links, comments
      </div> -->
      <a name="bottom"></a>
      <br />
      <div metal:use-macro="here/macros/commentform" />
    </div>

Is there not surely a much better way of implementing this?

Cheers,
Niall


On 5 Mar 2009 at 6:28, Niall Douglas wrote:

> On 3 Mar 2009 at 8:51, Simon Michael wrote:
> 
> > Well I'm not clear on what you're doing, but I'll make a guess: dtml-var 
> > "wikilink(ThePage.read())" ?
> 
> Do you mean by this that I replace portal_skins/zwiki/content.pt like 
> this:
> 
>     <div metal:define-macro="content" class="content">
>       <div tal:content="structure python:here.talsafe(
> 			here.wikilink(pageWithName('Masterinclude').read()+here.read()))">
>         content goes here..
>       </div>
>       <!-- <div tal:replace="structure 
> python:here.talsafe(options['body'])">
>         main text, subtopics links, comments
>       </div> -->
>       <a name="bottom"></a>
>       <br />
>       <div metal:use-macro="here/macros/commentform" />
>     </div>
> 
> I'll try giving this a go when I next get access to my website for a 
> while.
> 
> Niall
> 
> 
> --
> forwarded from http://zwiki.org/GeneralDiscussion#msg49AFE165.25316.46AFDC0@s_sourceforge.nedprod.com


--
forwarded from http://zwiki.org/GeneralDiscussion#msg49AFE89B.15287.4872AD3@s_sourceforge.nedprod.com