There's something funny about this tree tag. When this code is inside a tree tag it doesn't prevent acquisition. Code ---- <dtml-with this only> <dtml-var rubbish> </dtml-with> What do I need to do to make this work - should it be this.somethingOrOther? Also, anyone suggest what X I could put in <dtml-var X> to enable me to see something to help me figure out what goes on with these namespace things Andy Full code for the tree below <dtml-tree expr="lists" branches=objectValues sort=order> <dtml-if "meta_type=='Folder'"> <dtml-var title_or_id> <dtml-else> <dtml-if "kind=='discussion'"> <A HREF="<dtml-var listURL>"> <dtml-var title_or_id></A> <dtml-else> <dtml-with this only> <dtml-var rubbish> </dtml-with> </dtml-if> </dtml-if> <dtml-if listinfo> (<dtml-var listinfo>) </dtml-if> </dtml-tree> -- ------------------------------------------------- Andy Heath a.k.heath@open.ac.uk The Open University +44 (0) 114 2885738
Andy, Try this: <dtml-with aq_explicit only> <dtml-var rubbish> </dtml-with> Works for me 8¬) Phil phil.harris@zope.co.uk ----- Original Message ----- From: "Andy Heath" <a.k.heath@open.ac.uk> To: <zope@zope.org> Sent: 01 March 2000 13:27 Subject: [Zope] tree and dtml-with only not working for me
There's something funny about this tree tag.
When this code is inside a tree tag it doesn't prevent acquisition.
Code ---- <dtml-with this only> <dtml-var rubbish> </dtml-with>
What do I need to do to make this work - should it be this.somethingOrOther?
Also, anyone suggest what X I could put in <dtml-var X> to enable me to see something to help me figure out what goes on with these namespace things
Andy Full code for the tree below
<dtml-tree expr="lists" branches=objectValues sort=order>
<dtml-if "meta_type=='Folder'"> <dtml-var title_or_id> <dtml-else> <dtml-if "kind=='discussion'"> <A HREF="<dtml-var listURL>"> <dtml-var title_or_id></A> <dtml-else>
<dtml-with this only> <dtml-var rubbish> </dtml-with>
</dtml-if> </dtml-if> <dtml-if listinfo> (<dtml-var listinfo>) </dtml-if>
</dtml-tree>
-- ------------------------------------------------- Andy Heath a.k.heath@open.ac.uk The Open University +44 (0) 114 2885738
_______________________________________________ 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 )
Phil, nope. Doesn't find the property called rubbish. Baffled. Perhaps its an architecure-related bug - I'm running on Linux, what box are you on? Other ideas? Andy
Try this:
<dtml-with aq_explicit only> <dtml-var rubbish> </dtml-with>
Works for me 8¬)
Phil phil.harris@zope.co.uk
----- Original Message ----- From: "Andy Heath" <a.k.heath@open.ac.uk> To: <zope@zope.org> Sent: 01 March 2000 13:27 Subject: [Zope] tree and dtml-with only not working for me
There's something funny about this tree tag.
When this code is inside a tree tag it doesn't prevent acquisition.
Code ---- <dtml-with this only> <dtml-var rubbish> </dtml-with>
What do I need to do to make this work - should it be this.somethingOrOther?
Also, anyone suggest what X I could put in <dtml-var X> to enable me to see something to help me figure out what goes on with these namespace things
Andy Full code for the tree below
<dtml-tree expr="lists" branches=objectValues sort=order>
<dtml-if "meta_type=='Folder'"> <dtml-var title_or_id> <dtml-else> <dtml-if "kind=='discussion'"> <A HREF="<dtml-var listURL>"> <dtml-var title_or_id></A> <dtml-else>
<dtml-with this only> <dtml-var rubbish> </dtml-with>
</dtml-if> </dtml-if> <dtml-if listinfo> (<dtml-var listinfo>) </dtml-if>
</dtml-tree>
-- ------------------------------------------------- Andy Heath a.k.heath@open.ac.uk The Open University +44 (0) 114 2885738
_______________________________________________ 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 )
-- ------------------------------------------------- Andy Heath a.k.heath@open.ac.uk The Open University +44 (0) 114 2885738
Andy, Do all of the objects have a property 'rubbish'? Try something like: <dtml-with aq_explicit only> <dtml-if rubbish><dtml-var rubbish><dtml-else>No Rubbish</dtml-if> </dtml-with> This should check that the rubbish property exists and change what gets rendered depending on that. HTH Phil phil.harris@zope.co.uk ----- Original Message ----- From: "Andy Heath" <a.k.heath@open.ac.uk> To: "Phil Harris" <phil.harris@zope.co.uk> Cc: <zope@zope.org> Sent: Thursday, March 02, 2000 2:57 PM Subject: Re: [Zope] tree and dtml-with only not working for me
Phil, nope. Doesn't find the property called rubbish.
Baffled. Perhaps its an architecure-related bug - I'm running on Linux, what box are you on?
Other ideas?
Andy
Try this:
<dtml-with aq_explicit only> <dtml-var rubbish> </dtml-with>
Works for me 8¬)
Phil phil.harris@zope.co.uk
----- Original Message ----- From: "Andy Heath" <a.k.heath@open.ac.uk> To: <zope@zope.org> Sent: 01 March 2000 13:27 Subject: [Zope] tree and dtml-with only not working for me
There's something funny about this tree tag.
When this code is inside a tree tag it doesn't prevent acquisition.
Code ---- <dtml-with this only> <dtml-var rubbish> </dtml-with>
What do I need to do to make this work - should it be this.somethingOrOther?
Also, anyone suggest what X I could put in <dtml-var X> to enable me to see something to help me figure out what goes on with these namespace things
Andy Full code for the tree below
<dtml-tree expr="lists" branches=objectValues sort=order>
<dtml-if "meta_type=='Folder'"> <dtml-var title_or_id> <dtml-else> <dtml-if "kind=='discussion'"> <A HREF="<dtml-var listURL>"> <dtml-var title_or_id></A> <dtml-else>
<dtml-with this only> <dtml-var rubbish> </dtml-with>
</dtml-if> </dtml-if> <dtml-if listinfo> (<dtml-var listinfo>) </dtml-if>
</dtml-tree>
-- ------------------------------------------------- Andy Heath a.k.heath@open.ac.uk The Open University +44 (0) 114 2885738
_______________________________________________ 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 )
-- ------------------------------------------------- Andy Heath a.k.heath@open.ac.uk The Open University +44 (0) 114 2885738
_______________________________________________ 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 )
Phil,
Do all of the objects have a property 'rubbish'?
No, only some of them. The problem goes away if I make sure that every object has some value for this property but that's not a good solution. The code you suggest (the dtml-if ...) is exactly what I intended but on my system (Linux slackware 7 + zope 2.1.4) it finds higher level rubbish properties. Actually its not really called rubbish, that's just what I was using to check it worked before using it. It simply doesn't work - if it works for you lets find out what's different. Are you on a windows platform? What Zope version? Just to restate the problem for new readers:- The problem is to use "dtml-with X only" inside a tree rendering so as to be able to test whether the current object has some specific property. The code works outside trees but used in a tree it still seems to find properties by acquisition.
Try something like:
<dtml-with aq_explicit only> <dtml-if rubbish><dtml-var rubbish><dtml-else>No Rubbish</dtml-if> </dtml-with>
This code finds "rubbish" at higher acquisition levels. I know it shouldn't but it does. Anyone throw any light on it?
This should check that the rubbish property exists and change what gets rendered depending on that.
HTH
Phil phil.harris@zope.co.uk ----- Original Message ----- From: "Andy Heath" <a.k.heath@open.ac.uk> To: "Phil Harris" <phil.harris@zope.co.uk> Cc: <zope@zope.org> Sent: Thursday, March 02, 2000 2:57 PM Subject: Re: [Zope] tree and dtml-with only not working for me
Phil, nope. Doesn't find the property called rubbish.
Baffled. Perhaps its an architecure-related bug - I'm running on Linux, what box are you on?
Other ideas?
Andy
Try this:
<dtml-with aq_explicit only> <dtml-var rubbish> </dtml-with>
Works for me 8¬)
Phil phil.harris@zope.co.uk
----- Original Message ----- From: "Andy Heath" <a.k.heath@open.ac.uk> To: <zope@zope.org> Sent: 01 March 2000 13:27 Subject: [Zope] tree and dtml-with only not working for me
There's something funny about this tree tag.
When this code is inside a tree tag it doesn't prevent acquisition.
Code ---- <dtml-with this only> <dtml-var rubbish> </dtml-with>
What do I need to do to make this work - should it be this.somethingOrOther?
Also, anyone suggest what X I could put in <dtml-var X> to enable me to see something to help me figure out what goes on with these namespace things
Andy Full code for the tree below
<dtml-tree expr="lists" branches=objectValues sort=order>
<dtml-if "meta_type=='Folder'"> <dtml-var title_or_id> <dtml-else> <dtml-if "kind=='discussion'"> <A HREF="<dtml-var listURL>"> <dtml-var title_or_id></A> <dtml-else>
<dtml-with this only> <dtml-var rubbish> </dtml-with>
</dtml-if> </dtml-if> <dtml-if listinfo> (<dtml-var listinfo>) </dtml-if>
</dtml-tree>
-- ------------------------------------------------- Andy Heath a.k.heath@open.ac.uk The Open University +44 (0) 114 2885738
_______________________________________________ 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 )
-- ------------------------------------------------- Andy Heath a.k.heath@open.ac.uk The Open University +44 (0) 114 2885738
_______________________________________________ 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 )
-- ------------------------------------------------- Andy Heath a.k.heath@open.ac.uk The Open University +44 (0) 114 2885738
Andy, Hmm, I'm confused. I use this 'trick' all the time, here's a bit of code from a method of mine: <dtml-with aq_explicit only> <dtml-if url> <a href="<dtml-var url>" title="<dtml-if status><dtml-var status></dtml-if>" target=main><dtml-var ident></a> <dtml-else> <dtml-var ident> </dtml-if> </dtml-with> Which works beautifully. Hmmm confusion reigns!??! Phil ----- Original Message ----- From: "Andy Heath" <a.k.heath@open.ac.uk> To: "Phil Harris" <phil.harris@zope.co.uk> Cc: "zope" <zope@zope.org> Sent: Thursday, March 02, 2000 4:58 PM Subject: Re: [Zope] tree and dtml-with only not working for me
Phil,
Do all of the objects have a property 'rubbish'?
No, only some of them. The problem goes away if I make sure that every object has some value for this property but that's not a good solution. The code you suggest (the dtml-if ...) is exactly what I intended but on my system (Linux slackware 7 + zope 2.1.4) it finds higher level rubbish properties. Actually its not really called rubbish, that's just what I was using to check it worked before using it.
It simply doesn't work - if it works for you lets find out what's different. Are you on a windows platform? What Zope version?
Just to restate the problem for new readers:-
The problem is to use "dtml-with X only" inside a tree rendering so as to be able to test whether the current object has some specific property. The code works outside trees but used in a tree it still seems to find properties by acquisition.
Try something like:
<dtml-with aq_explicit only> <dtml-if rubbish><dtml-var rubbish><dtml-else>No Rubbish</dtml-if> </dtml-with>
This code finds "rubbish" at higher acquisition levels. I know it shouldn't but it does. Anyone throw any light on it?
This should check that the rubbish property exists and change what gets rendered depending on that.
HTH
Phil phil.harris@zope.co.uk ----- Original Message ----- From: "Andy Heath" <a.k.heath@open.ac.uk> To: "Phil Harris" <phil.harris@zope.co.uk> Cc: <zope@zope.org> Sent: Thursday, March 02, 2000 2:57 PM Subject: Re: [Zope] tree and dtml-with only not working for me
Phil, nope. Doesn't find the property called rubbish.
Baffled. Perhaps its an architecure-related bug - I'm running on Linux, what box are you on?
Other ideas?
Andy
Try this:
<dtml-with aq_explicit only> <dtml-var rubbish> </dtml-with>
Works for me 8¬)
Phil phil.harris@zope.co.uk
----- Original Message ----- From: "Andy Heath" <a.k.heath@open.ac.uk> To: <zope@zope.org> Sent: 01 March 2000 13:27 Subject: [Zope] tree and dtml-with only not working for me
There's something funny about this tree tag.
When this code is inside a tree tag it doesn't prevent acquisition.
Code ---- <dtml-with this only> <dtml-var rubbish> </dtml-with>
What do I need to do to make this work - should it be this.somethingOrOther?
Also, anyone suggest what X I could put in <dtml-var X> to enable me to see something to help me figure out what goes on with these namespace things
Andy Full code for the tree below
<dtml-tree expr="lists" branches=objectValues
sort=order>
<dtml-if "meta_type=='Folder'"> <dtml-var title_or_id> <dtml-else> <dtml-if "kind=='discussion'"> <A HREF="<dtml-var listURL>"> <dtml-var title_or_id></A> <dtml-else>
<dtml-with this only> <dtml-var rubbish> </dtml-with>
</dtml-if> </dtml-if> <dtml-if listinfo> (<dtml-var listinfo>) </dtml-if>
</dtml-tree>
-- ------------------------------------------------- Andy Heath a.k.heath@open.ac.uk The Open University +44 (0) 114 2885738
_______________________________________________ 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 )
-- ------------------------------------------------- Andy Heath a.k.heath@open.ac.uk The Open University +44 (0) 114 2885738
_______________________________________________ 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 )
-- ------------------------------------------------- Andy Heath a.k.heath@open.ac.uk The Open University +44 (0) 114 2885738
_______________________________________________ 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 )
Andy, I sent before reading all your mail. This technique works on NT and a Linux box both running 2.1.4. Hmmm ----- Original Message ----- From: "Andy Heath" <a.k.heath@open.ac.uk> To: "Phil Harris" <phil.harris@zope.co.uk> Cc: "zope" <zope@zope.org> Sent: Thursday, March 02, 2000 4:58 PM Subject: Re: [Zope] tree and dtml-with only not working for me
Phil,
Do all of the objects have a property 'rubbish'?
No, only some of them. The problem goes away if I make sure that every object has some value for this property but that's not a good solution. The code you suggest (the dtml-if ...) is exactly what I intended but on my system (Linux slackware 7 + zope 2.1.4) it finds higher level rubbish properties. Actually its not really called rubbish, that's just what I was using to check it worked before using it.
It simply doesn't work - if it works for you lets find out what's different. Are you on a windows platform? What Zope version?
Just to restate the problem for new readers:-
The problem is to use "dtml-with X only" inside a tree rendering so as to be able to test whether the current object has some specific property. The code works outside trees but used in a tree it still seems to find properties by acquisition.
Try something like:
<dtml-with aq_explicit only> <dtml-if rubbish><dtml-var rubbish><dtml-else>No Rubbish</dtml-if> </dtml-with>
This code finds "rubbish" at higher acquisition levels. I know it shouldn't but it does. Anyone throw any light on it?
This should check that the rubbish property exists and change what gets rendered depending on that.
HTH
Phil phil.harris@zope.co.uk ----- Original Message ----- From: "Andy Heath" <a.k.heath@open.ac.uk> To: "Phil Harris" <phil.harris@zope.co.uk> Cc: <zope@zope.org> Sent: Thursday, March 02, 2000 2:57 PM Subject: Re: [Zope] tree and dtml-with only not working for me
Phil, nope. Doesn't find the property called rubbish.
Baffled. Perhaps its an architecure-related bug - I'm running on Linux, what box are you on?
Other ideas?
Andy
Try this:
<dtml-with aq_explicit only> <dtml-var rubbish> </dtml-with>
Works for me 8¬)
Phil phil.harris@zope.co.uk
----- Original Message ----- From: "Andy Heath" <a.k.heath@open.ac.uk> To: <zope@zope.org> Sent: 01 March 2000 13:27 Subject: [Zope] tree and dtml-with only not working for me
There's something funny about this tree tag.
When this code is inside a tree tag it doesn't prevent acquisition.
Code ---- <dtml-with this only> <dtml-var rubbish> </dtml-with>
What do I need to do to make this work - should it be this.somethingOrOther?
Also, anyone suggest what X I could put in <dtml-var X> to enable me to see something to help me figure out what goes on with these namespace things
Andy Full code for the tree below
<dtml-tree expr="lists" branches=objectValues
sort=order>
<dtml-if "meta_type=='Folder'"> <dtml-var title_or_id> <dtml-else> <dtml-if "kind=='discussion'"> <A HREF="<dtml-var listURL>"> <dtml-var title_or_id></A> <dtml-else>
<dtml-with this only> <dtml-var rubbish> </dtml-with>
</dtml-if> </dtml-if> <dtml-if listinfo> (<dtml-var listinfo>) </dtml-if>
</dtml-tree>
-- ------------------------------------------------- Andy Heath a.k.heath@open.ac.uk The Open University +44 (0) 114 2885738
_______________________________________________ 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 )
-- ------------------------------------------------- Andy Heath a.k.heath@open.ac.uk The Open University +44 (0) 114 2885738
_______________________________________________ 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 )
-- ------------------------------------------------- Andy Heath a.k.heath@open.ac.uk The Open University +44 (0) 114 2885738
_______________________________________________ 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 )
Andy Heath schrieb:
Phil,
This code finds "rubbish" at higher acquisition levels. I know it shouldn't but it does. Anyone throw any light on it?
No light, no solution, only a bad workaround: <dtml-let temp_rubbish=rubbish> <dtml-tree ...> # your tree code ... <dtml-if "rubbish <> temp_rubbish"> <dtml-var rubbish> </dtml-if> ... </dtml-tree> </dtml-let> hth, Thomas
Thomas Weiner schrieb:
Andy Heath schrieb:
Phil,
This code finds "rubbish" at higher acquisition levels. I know it shouldn't but it does. Anyone throw any light on it?
No light, no solution, only a bad workaround:
apologies, ignore my pervious posting, try instead: <dtml-let newid=id> <dtml-with "_[newid]" only> <dtml-if rubbish> <dtml-var rubbish> </dtml-if> </dtml-with> </dtml-let> in your tree code. This gives me the expected results. Regards, Thomas
Andy Heath wrote: [ preventing acquisition within a tree-tag ] After going through the archives my third (and hopefully better tested) trial with this :-) In your Extensions directory create an external python method with this code: def prev_acqu(self, prop): if self.__dict__.has_key(prop): return getattr(self,prop) else: return '' add it with the id prev_acqu (or anything else you like better) to a folder in the acquisition path. In your tree code do: <dtml-var "prev_acqu('rubbish')"> If you choose a different id, of course you have to take it here, too. Apologies again for jumping into this thread without exactly verifying my code examples yesterday, thomas
Thomas Weiner wrote:
Andy Heath wrote:
Thomas - even more tree problems. Sorry to mail you direct but its urgent for me (I promised it up by tonight). Can you help. The problem no is getting the URL's of objects inside tree code - absolute preferred but relative would do if it was all that would work. Tried all the solutions in the ObjectURLs howto but none of them work. Any attempt to generate an absolute url gets the local name bit loses the path to the object. Code below ---------- where it says <A HREF="&dtml-URL1;/silly" TARGET="ltscmain"> I need to get a url for current object. Logically, I need the equivalent of "&dtml-url-<dtml-var id>>" How can I do this? Code (note, the soln you sent me for "rubbish" fits with this but isn't shown here. ------------------------------- <dtml-tree expr="lists" branches=objectValues sort=order> <dtml-if "meta_type=='Folder'"> <dtml-var title_or_id> <dtml-elif "kind=='discussion'"> <A HREF="<dtml-var listURL>" TARGET="ltscmain"> <dtml-var title_or_id></A> <dtml-elif "kind=='content'"> <A HREF="&dtml-URL1;/silly" TARGET="ltscmain"> <dtml-var title_or_id></A> <dtml-else> <A HREF="mailto:a.k.heath@open.ac.uk"> Site problem - please email details to a.k.heath@open.ac.uk</A> </dtml-if> <dtml-if listinfo> (<dtml-var listinfo>) </dtml-if> </dtml-tree> Andy -- ------------------------------------------------- Andy Heath a.k.heath@open.ac.uk The Open University +44 (0) 114 2885738
Don't worry, I've cracked it now. "absolute_url()" works. <downhearted-sigh> the quality of this documentation </downhearted-sigh> Thanks to all responders Andy Andy Heath wrote:
Thomas Weiner wrote:
Andy Heath wrote:
Thomas - even more tree problems. Sorry to mail
-- ------------------------------------------------- Andy Heath a.k.heath@open.ac.uk The Open University +44 (0) 114 2885738
participants (3)
-
Andy Heath -
Phil Harris -
Thomas Weiner