[Zope] Newbie question about Zope/Plone interaction

Paul Winkler pw_lists at slinkp.com
Thu Jul 8 12:48:19 EDT 2004


On Thu, Jul 08, 2004 at 07:56:42AM -0700, Daniel Cruz wrote:
> 
>  
> 
> Zope Folk,
> 
>  
> 
>     Hey all.  I?m pretty sure that what I?m about to ask is a pretty stupid question, but for the life of me I can?t figure it out.  I?m not a programmer by trade, and am just volunteering to build a site for a small Human Rights NGO in Eastern Europe.  I figured it?d be no problem since I know Dreamweaver pretty well, but they didn?t mention any dynamic needs till after I?d agreed.  Sneaky bastards.  ;)  Anyways, I installed Plone & Zope on Monday and had a pretty easy time getting it up and running and converting some static pages I?d built into Zope Page Templates.  The problem is that I?ve spent the last 3 days trying to get my ZPTs to display the content I?ve already entered into Plone and had no success.  I?ve read the Plone manual, done the Zope Tutorial, and read all of the parts of the Zope manual that seem applicable, but I?m still hitting my head against a brick wall.
> 
>     Here are the assumptions I?ve been working under:  A. The front-end users at the office can enter content through the Plone portal which in turn can be displayed by ZPTs.

So far so good.

>  B.  My site folder in Zope should be in a separate folder than the one that contains Plone. 

This is very unusual.  Can you explain your thinking here?

It's more common to put your templates somewhere under portal_skins 
somewhere in plone itself, i.e. learn how the skin tool works.


> C.  My ZPTs can access content in Plone by simple statements like ?<span tal:content="Plone/latest"></span>?, ?Plone? being the Plone folder in the Zope Root Folder, ?latest? being the name of a news item I?ve uploaded into Plone.  I?ve been told on the online chat that I should be entering ?here.latest? and I?ve tried that as well, using every possible permutation of what ?here? may mean (including literally ?here?) with no luck.

In ZPTs, you need to provide a namespace before you can look up a named
object like your Plone site folder. The namespace can be a variable 
you defined previously, or more commonly it can be one of the several
built-in namespaces.

"here" is one such built-in namespace. It means "look up the the next
name in the current folder, possibly using contextual acquisition."

Try:
<span tal:content="structure here/Plone/latest"></span>

People probably advised you to try "here/latest" because they didn't
realize you were using templates 

Note also the "structure" keyword - that tells ZPT to turn off html-quoting
of the content.

-- 

Paul Winkler
http://www.slinkp.com


More information about the Zope mailing list