[Zope-dev] Weird acquisition behavior of Page Templates

Peter Sabaini sabaini@inode.at
Mon, 05 May 2003 09:32:35 +0200


This is a cryptographically signed message in MIME format.

--------------ms040300090506000805020605
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Dont know if its a bug, but if it is, it is by design.

ZopePageTemplates inherit from Shared.DC.Scripts.Script.Script, which 
inherits from BindingsUI which inherits from Bindings, and theres a 
__before_publishing_traverse__ hook responsible for the 
"traverse_subpath" stuff.  Not sure about the rationale for this myself.

  - peter.

Paul Winkler wrote:
> Here's a puzzler...
> 
> So we all know how you can use context acquisition by visiting various
> URLs in the browser, right?  E.g. if let's say we have a folder
> in the zope root, called my_folder. Let's say it contains an image,
> a dtml method, and a page template called respectively my_image,
> my_dtml, and my_pt.
> 
> Now we all know that if you browse to /my_folder/my_image/my_dtml,
> you'll see my_dtml rendered. my_image just gets added to its acquisition
> path. 
> 
> Likewise if you visit /my_folder/my_dtml/my_template,
> you'll see my_template rendered, with my_dtml at the end of
> the aq_chain.
> 
> And if you visit /my_folder/my_template/my_dtml, you'll
> see my_dtml with my_template on the aq_chain.
> 
> except the last one is not true. :-P
> 
> As far as i can tell, if you put a page template anywhere in the URL,
> it gets rendered no matter what else comes after it in the URL.
> /my_folder/my_template/foo/bar/baz...  no matter what, you get
> my_template rendered.
> 
> what the hell is up with that?  Bug?
> 
> try it yourself. zope 2.6.1.
> 

--------------ms040300090506000805020605
Content-Type: application/x-pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIJcjCC
AxcwggKAoAMCAQICAwlZhTANBgkqhkiG9w0BAQQFADCBkjELMAkGA1UEBhMCWkExFTATBgNV
BAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMQ8wD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