(newbie)-Anyone Please Help me
I have Been testing out Zope for possible use at work and I am really stuck. I have a simple dtml method called userid that gets REMOTE_ADDR and stuff. I set up a test_html page and put in it <dtml-var userid>. This works great. now I make a folder called methods with a user interface and acl. I put the useid method into the methods folder. I go back to the root folder and view test_html and it can't find the userid method anymore. So I try <dtml-var methods.userid> and that does not work. What am I doing wrong? Have I missed something basic. I thought that Zope would "traverse" the folders and find the <dtml-var>. I can do a find in Zope and find it in /methods/userid, Do I need to do something different to call the method ? Please Help Rick -- Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damage per incident.
ozric wrote:
I have Been testing out Zope for possible use at work and I am really stuck. I have a simple dtml method called userid that gets REMOTE_ADDR and stuff. I set up a test_html page and put in it <dtml-var userid>. This works great. now I make a folder called methods with a user interface and acl. I put the useid method into the methods folder. I go back to the root folder and view test_html and it can't find the userid method anymore. So I try <dtml-var methods.userid> and that does not work. What am I doing wrong? Have I missed something basic. I thought that Zope would "traverse" the folders and find the <dtml-var>. I can do a find in Zope and find it in /methods/userid, Do I need to do something different to call the method ?
Have you tried <dtml-var "methods.userid()">? ------------------------------------------------------ Andres Corrada-Emmanuel Email: andres@corrada.com Owner http://www.corrada.com/mamey Mamey Phone: (413) 587-9595 ------------------------------------------------------
ozric wrote:
I have Been testing out Zope for possible use at work and I am really stuck. I have a simple dtml method called userid that gets REMOTE_ADDR and stuff. I set up a test_html page and put in it <dtml-var userid>. This works great. now I make a folder called methods with a user interface and acl. I put the useid method into the methods folder. I go back to the root folder and view test_html and it can't find the userid method anymore. So I try <dtml-var methods.userid> and that does not work. What am I
Should be <dtml-var "methods.userid">. When you are not using a single name, you must treat it as an expression and put it in quotation.
doing wrong? Have I missed something basic. I thought that Zope would "traverse" the folders and find the <dtml-var>. I can do a find in Zope
Zope's acquisition can acquire objects in parent folders, but not in sub folders, so you cannot simply use ``userid'' to access your method in a sub folder from you root directory.
and find it in /methods/userid, Do I need to do something different to call the method ?
Please Help Rick -- Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damage per incident.
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope No cross posts or HTML encoding! (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
-snip- I tried the <dtml-var "methods.userid"> and that finds the userid file, but it returns plain text unrendered. here is whats in unserid. <Center><em>Notice:<br>Restricted Access All IP's logged!</em><br> Your IP:<dtml-with REQUEST><!--#var REMOTE_ADDR--><br> Login In:<!--#var AUTHENTICATED_USER--></dtml-with><br></center> and that is how I get it back too. If I look at it from the methods folder in the manager it looks fine. Notice: Restricted Access All IP's logged! Your IP:192.168.0.100 Login In:superuser I have a feeling that I am missing more then I first thought. Rick
ozric wrote:
-snip- I tried the <dtml-var "methods.userid"> and that finds the userid file, but it returns plain text unrendered. here is whats in unserid.
Sorry about the former incorrect suggestion. This should avoid the problem: <dtml-with methods> <dtml-var userid> </dtml-with> This is because "userid" is in fact a DTML method, in another word, a function. So used in a expression (inside quotation marks), it should have the parentheses and desired arguments. Calling it without using the expression syntax avoid giving these function arguments yourself.
<Center><em>Notice:<br>Restricted Access All IP's logged!</em><br> Your IP:<dtml-with REQUEST><!--#var REMOTE_ADDR--><br> Login In:<!--#var AUTHENTICATED_USER--></dtml-with><br></center>
and that is how I get it back too. If I look at it from the methods folder in the manager it looks fine.
Notice: Restricted Access All IP's logged! Your IP:192.168.0.100 Login In:superuser
I have a feeling that I am missing more then I first thought.
Rick
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope No cross posts or HTML encoding! (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
participants (3)
-
Andres Corrada -
Li Dongfeng -
ozric