Hi all, My first posting on this list :-) I have two questions for you: * How do i get a list of all subfolders off the current folder, using dtml-in ?? Or better, how do i get a list of subfolders which contain a property i specify? * How do i get the name of the current object in the situation that i am in the method index_html of the folder News. The value i want to get is 'News', but how do i get it? TIA, -- Arjan Scherpenisse, A.Scherpenisse@zap.a2000.nl ICQ# 27592135
-----Original Message----- From: Arjan Scherpenisse [mailto:arjan@node1281e.a2000.nl]On Behalf Of Arjan Scherpenisse Sent: Tuesday, November 09, 1999 1:20 AM To: zope@zope.org Subject: [Zope] newbie questions
Hi all,
My first posting on this list :-) I have two questions for you:
* How do i get a list of all subfolders off the current folder, using dtml-in ?? Or better, how do i get a list of subfolders which contain a property i specify?
try: <dtml-in "objectValues(['Folder'])"> <dtml-if "hasProperty('desiredProperty' and desiredProperty == 'desiredValue')"> <a href="<dtml-var absolute_url>"><dtml-var id></a> </dtml-if> </dtml-in>
* How do i get the name of the current object in the situation that i am in the method index_html of the folder News. The value i want to get is 'News', but how do i get it?
Um, if it really is a method (a 'DTML method') it already has this in the default content it is created with: <P>This is the <!--#var document_id--> Document in the <!--#var title_and_id--> Folder.</P> in which case <!--#var document_id--> yields 'index_html' and <!--#var title_and_id--> yields 'News'. On the other hand, if index_html is a DTML Document then you would have to change the reference to the Folder to: <!--#var "PARENTS[0].title_and_id"--> Rik
Hello, I am a newbie trying some of the code that people posts in the list. Rik Hoekstra wrote: ...
try:
<dtml-in "objectValues(['Folder'])"> <a href="<dtml-var absolute_url>"><dtml-var id></a> </dtml-in>
When I try the code above in a DTML Document I get nothing. The folder where the DTML doc is does contain other folders. What could be going wrong? Thanks in advance. -- Eduardo Fernández Corrales eduardo@sistelnet.es Sistelnet Integraciones Telemáticas - http://www.sistelnet.es
-----Original Message----- From: eduardo@correo.sistelnet.es [mailto:eduardo@correo.sistelnet.es]On Behalf Of Eduardo Fernandez Corrales Sent: Wednesday, November 10, 1999 5:44 PM To: hoekstra@fsw.LeidenUniv.nl Cc: Arjan Scherpenisse; zope@zope.org Subject: Re: [Zope] newbie questions
Hello,
I am a newbie trying some of the code that people posts in the list.
Rik Hoekstra wrote: ...
try:
<dtml-in "objectValues(['Folder'])"> <a href="<dtml-var absolute_url>"><dtml-var id></a> </dtml-in>
When I try the code above in a DTML Document I get nothing.
Ah, if you use a DTML Document you should use <dtml-with PARENTS[0]> <dtml-in "objectValues(['Folder'])"> <a href="<dtml-var absolute_url>"><dtml-var id></a> </dtml-in> </dtml-with> because a DTML Document is an object of its own, that does not contain other objects. I assumed you were using a DTML Method that acts as a method of its containing folder. Rik
Eduardo Fernandez Corrales wrote:
<dtml-in "objectValues(['Folder'])"> <a href="<dtml-var absolute_url>"><dtml-var id></a> </dtml-in>
When I try the code above in a DTML Document I get nothing. The folder where the DTML doc is does contain other folders.
What could be going wrong?
<dtml-in parentFolder expr="objectValues(['Folder'])"> what you've got is searching in the document for folders, and not finding them. It works in a Method because a method is just an appendage of a folder. -- Ethan "mindlace" Fremen you cannot abdicate responsibility for your ideology.
participants (5)
-
Arjan Scherpenisse -
Eduardo Fernandez Corrales -
Ethan Fremen -
Rik Hoekstra -
Rik Hoekstra