[ZPT] determining the value of a folder's property
robert
robert@redcor.ch
Mon, 7 Apr 2003 05:40:15 +0200
I do not understand your question.
Navsort returns a list of foders. So you have to iterate over the list to=20
display the lot of them.
my dtml is rusty I think it is something like this:
<dtml-in "navsort(...)">
<dtml-var title_or_id>
</dtml-in>
Robert
Am Sonntag, 6. April 2003 09:05 schrieb Tamir Halperin:
> thx, Robert.
>
> Would the sorting of the folders also be possible using dtml? Imagine
> another property, in addition to "navigation". Let's call it "navsort". Is
> it possible to use dtml somehow to retrieve the folders based on the value
> of the navsort proerty?
>
> > -----Original Message-----
> > From: robert [mailto:robert@redcor.ch]
> > Sent: Sunday, April 06, 2003 1:23 AM
> > To: Jamie; zpt@zope.org
> > Subject: Re: [ZPT] determining the value of a folder's property
> >
> >
> > <li tal:condition=3D"subfolder/navigation | nothing">
> > avoids an error when navigation does not exist.
> >
> > to have the folders sorted on an other field than the name
> > you have to create
> > your own routine in a python script you have to call yourself like:
> > <span tal:repeat =3D "subfolder
> > python:here.mysortscript(here.objectValues('Folder'))">
> >
> > assuming your script has a paramater folders in which you
> > pass the folders to
> > sort:
> >
> > names=3D[]
> > result=3D[]
> > for folder in folders:
> > names.append(folder.theFieldIWant)
> > names.sort()
> > for name in names:
> > result.append(dic[name])
> > return result
> >
> > HTH
> > robert
> >
> > Am Sonntag, 6. April 2003 04:41 schrieb Jamie:
> > > I have a Dynamic folder driven navigation system set up using this:
> > >
> > > <UL>
> > > <li tal:condition=3D "python:len(request.PARENTS) > 2" ><a href=3D
> > > "..">Return
> > > to parent</a></li>
> > >
> > > <span tal:repeat =3D "subfolder python:here.objectValues('Folder')">
> > > <li tal:condition=3D"subfolder/navigation">
> > > <a tal:attributes=3D "href subfolder/absolute_url"
> > > tal:content=3D "subfolder/title_or_id">
> > > link to subfolder
> > > </a>
> > > </li>
> > > </span>
> > > </ul>
> > >
> > > I have added a Boolean property (navigation) to all of my
> >
> > folders which
> >
> > > lets me determine whether a folder should show up in my menu. If I
> > > create a folder without the navigation property it gives me
> >
> > an error. Is
> >
> > > there a way to avoid this, because I would like to have
> >
> > some folders not
> >
> > > have this property at all.
> > >
> > > Also, I need a way to sort the folders that show up in the
> >
> > menu other
> >
> > > than alphabetically.
> > >
> > > Thanks for your time,
> > >
> > > Jamie White
> > >
> > > Jamie@brobus.net
> >
> > --
> > mit freundlichen Gr=FCssen
> >
> > Robert Rottermann
> > www.redCOR.ch
> >
> >
> > _______________________________________________
> > ZPT mailing list
> > ZPT@zope.org
> > http://mail.zope.org/mailman/listinfo/zpt
>
> _______________________________________________
> ZPT mailing list
> ZPT@zope.org
> http://mail.zope.org/mailman/listinfo/zpt
=2D-=20
mit freundlichen Gr=FCssen
Robert Rottermann
www.redCOR.ch