Jay Dorsey wrote:
How would I go about using manage_addPageTemplate to add a template in a directory other than the one the script is called in? For example, my folder tree looks
item = context.manage_addProduct['PageTemplates'].manage_addPageTemplate(id, text="blah", title="my title")
<snip> Figured it out--doh!
context.Folder1.manage_addProduct['PageTemplates'].manage_addPageTemplate(id, text="blah", title="my title")
...
Sometimes its right in front of you :)
Yep. The thing to remember is that 'context' is just a name for the folder you're called on, and that any folder will do.
Also, I just found the Zope Documentation Projects FAQ section (http://zdp.zope.org/projects/zfaq). I wonder how many people are on the ZDP team; there seems to be maybe 100 questions there--I know I've asked that many in the last week alone ;-)
The page says the FAQ is outdated, is there any movement for an updated version of a Zope FAQ/Snippets site? I'd just as soon chip in my effort and contribute to an existing project, than start my own.
The ZopeLabs cookbook is the main hangout for code snippets. As for the FAQ: not that I know of, but there's plenty of buzz surrounding the concept recently. I've been threatening to make a "library" of knowledge from the list for a little while: I guess it's not much of an extension of the idea (and code!) to a FAQ site like you're talking about. (The actual development is a pretty simple task, actually, but there are administrative obstacles to overcome before I could do actual work. But the real work is in the content.) Your issue above would fit well on zopelabs.com. Go file a recipe! --jcc