Re: [Zope] setting properties - some basic questions
Jason: I would suggest taking a look at the following: The Zope Book: http://www.zope.org/Members/michel/ZB Dieter's excellent Zope Book (Chapter 3): http://www.dieter.handshake.de/pyprojects/zope/book/chap3.html HowTo: Advanced DTML Techniques: http://www.zope.org/Documentation/How-To/AdvancedDTML and finally... HowTo: The DTML NameSpace HowTo: http://www.zope.org/Members/michel/HowTos/NameSpaceHow-To Those are all good questions; however I think you will be able to find all of the answers you need at the above links. I also think you will get a better fundamental understanding of how Zope works and the various mechanisms/ways to go about programming in Zope after reading the above material. I'm certainly not trying to steer you away from asking questions to the mailing list; sometimes it is easier and quicker to point to documentation rather than give a cursory answer. Hope this helps, Andrew Williams
From: "Jason Cunliffe" <jasonic@nomadicsltd.com> To: <zope@zope.org> Subject: [Zope] setting properties - some basic questions Date: Fri, 2 Mar 2001 07:43:23 -0500
Hello
I have been studying Caseman's excellent How-To ideas for clean handling of Javascripts in Zope: http://www.zope.org/Members/Caseman/client_script_howto [Thank You!]
So now I have a boolean property 'admin' for my site folders and DTMLDocuments. When admin is 'ON' various Methods are rendered on the pages some simple <dtml-if> statements such as:
<dtml-if admin> admin = <dtml-var admin><br> <dtml-var showjavascripts> <dtml-else> admin is OFF </dtml-if>
Please, can anyone teach me how to:
Q1. set 'admin' on or off by a button on the same page?
Q2. set 'admin' on or off by a button on another page?
Q3. toggle 'admin' to its oppposite state via a button?
Q4. perform 1, 2, 3 above via a DTML/Python method I can call from anywhere?
..my documents also have a 'scripts' property [type = 'Lines']. 'scripts' lists the names of various javascript functions wrapped as DTMLmethods.
Q5. How can I edit the text in different lines of such a a property?
This is my 'showjavascripts' DTMLmethod:
The script properties of this DTMLdocument are:<br><br> <dtml-in scripts> <dtml-var sequence-item><br> </dtml-in>
#note: scripts is a type='lines' property as above
Q6. How do to create and set a property for whole lot of documents using DTML and/or Python?
For example, I have a folder 'NEWARTISTS' and I want to add 'admin' and 'scripts' properties for all documents and folders within those...
Q7. How to make this all work so that qualified users can login into 'admin' pages inside certain folders which will then turn 'on' the admin property flag automatically for everythign below that?
Presumably 1, 2, 3, 5, 6, 7 will all use 4...
I imagine this is all incredibly simple, but I need a little help to reach the aaha!! moment :-)
+FINALLY, I have want to apply the same approach setting 'scripts' and 'admin' for index_html, but since it is a method it has no properties. If I apply 'scripts' and folder properties it to its parent folder it will then apply to everyhting below there by acquisition. This is handy but often I need finer grained control than that. Changing index_html to be a DTMLdocument does not work.
Any suggestions for Thinking Zope here?
Thanks
- Jason ___________________________________________________________ Jason CUNLIFFE = NOMADICS['Interactive Art and Technology']
_______________________________________________ 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 )
_________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com
participants (1)
-
Andrew Williams