Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   Re: Zope problem: objectValues('Folder') (http://www.velocityreviews.com/forums/t319478-re-zope-problem-objectvalues-folder.html)

Max M 07-10-2003 08:20 AM

Re: Zope problem: objectValues('Folder')
 
Jens Riedel wrote:

> I try to get a list of subfolders by using


> <ul>
> <dtml-in expr="objectValues('Folder')">
> <li><a href="&dtml-absolute_url;"><dtml-var title_or_id></a></li><br>
> </dtml-in>
> </ul>



If you have written it exactly like that, it should work. You have no
folders inside the folder you are running it in then.


> Does anybody know where the problem with "objectValues('Folder/File')" is?



I assume you have not written your code that way, but rather:

objectValues(['Folder','File'])


regards Max M


Jens Riedel 07-10-2003 08:29 AM

Re: Zope problem: objectValues('Folder')
 
Max M schrieb:

>><ul>
>><dtml-in expr="objectValues('Folder')">
>><li><a href="&dtml-absolute_url;"><dtml-var title_or_id></a></li><br>
>></dtml-in>
>></ul>


> If you have written it exactly like that, it should work. You have no
> folders inside the folder you are running it in then.


That's my problem. I followed the instructions of the Zope Book example
exactly and created 3 folders in the folder I use the
objectValues()-method on.

In another example I have the folder "photos" with 3 jpg-files in it.
When I call "photos.objectValues()" I get a list with the 3 files, if I
use "photos.objectValues('File')" I get nothing...
The objectValues-method seems not working when I specify it on a type.


> I assume you have not written your code that way, but rather:
>
> objectValues(['Folder','File'])


Correct, I did write either objectValues('Folder') or
objectValues('File') in my code.

Greetings,
Jens


Max M 07-10-2003 09:15 AM

Re: Zope problem: objectValues('Folder')
 
Jens Riedel wrote:

> Max M schrieb:
>
>>> <ul>
>>> <dtml-in expr="objectValues('Folder')">
>>> <li><a href="&dtml-absolute_url;"><dtml-var title_or_id></a></li><br>
>>> </dtml-in>
>>> </ul>

>
>
>> If you have written it exactly like that, it should work. You have no
>> folders inside the folder you are running it in then.

>
>
> That's my problem. I followed the instructions of the Zope Book example
> exactly and created 3 folders in the folder I use the
> objectValues()-method on.



hmmm ... it is not a zope problem. objectValues() works!

try

<ul>
<dtml-in objectValues>
<li>&dtml-meta_type;</li>
</dtml-in>
</ul>


That should give a hint.

regards Max M


Jens Riedel 07-10-2003 11:22 AM

Re: Zope problem: objectValues('Folder')
 
The problem seems to be somewhere else:

I used the objectValues('Folder')-method in a DTML-method named
'navigation'. I include <dtml-var navigation> in a
'standard_html_header' DTML method, and this standard_html_header is
used in the index_html document.
All three are in the same folder which contains 3 Subfolders. If I view
'navigation' or 'standard_html_header' in the management area, I see the
3 folders, but in the index_html they don't appear. Everything else in
the standard_html_header, like stylesheets etc. are correctly shown so
I'm sure that the correct standard_html_header is included.

Jens


Max M 07-10-2003 11:37 AM

Re: Zope problem: objectValues('Folder')
 
Jens Riedel wrote:

> I used the objectValues('Folder')-method in a DTML-method named
> 'navigation'. I include <dtml-var navigation> in a
> 'standard_html_header' DTML method, and this standard_html_header is
> used in the index_html document.



Navigation may be used for something else.


Does it work if you render only the navigation method?

Also, you will find it much easier to find replies to Zope questions on
the zope mailing list.

regards Max M


Jens Riedel 07-10-2003 11:56 AM

Re: Zope problem: objectValues('Folder')
 
Max M schrieb:

>>I used the objectValues('Folder')-method in a DTML-method named
>>'navigation'. I include <dtml-var navigation> in a
>>'standard_html_header' DTML method, and this standard_html_header is
>>used in the index_html document.


> Does it work if you render only the navigation method?


Yes, that's what confuses me. The navigation works completely if I call
it with http://localhost:8080/ZopeZoo/navigation, also the
standard_html_header does. But when I include it in the index_html, the
list of folders vanishes, the rest of navigation works.


> Also, you will find it much easier to find replies to Zope questions on
> the zope mailing list.


thanx for the hint, I'll try it.

regards,
Jens




Lee Harr 07-11-2003 06:20 AM

Re: Zope problem: objectValues('Folder')
 
In article <3F0D4C74.5040304@gmx.de>, Jens Riedel wrote:
> The problem seems to be somewhere else:
>
> I used the objectValues('Folder')-method in a DTML-method named
> 'navigation'. I include <dtml-var navigation> in a
> 'standard_html_header' DTML method, and this standard_html_header is
> used in the index_html document.
> All three are in the same folder which contains 3 Subfolders. If I view
> 'navigation' or 'standard_html_header' in the management area, I see the
> 3 folders, but in the index_html they don't appear. Everything else in
> the standard_html_header, like stylesheets etc. are correctly shown so
> I'm sure that the correct standard_html_header is included.
>
> Jens
>



Is index_html a DTML_Document, maybe?

In that case, I think objectValues() would look in the index_html for
its objects, instead of the containing folder.

Try creating a new DTML_Method and putting your code in there.



All times are GMT. The time now is 09:19 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.