Re: [Zope] Sequence number inside a tree
| OdesÃlatel: Alfredo P. Ricafort <alpot@mylinuxsite.com> | Is there a way to generate a sequence number inside a <dtml-tree> or | replace the + sign with a sequence number? | 1. Branch_1 | 1.1 Branch_1.1 | 1.2 Branch_1.2 | 1.2.1 Branch_1.2.1 | 2. Branch_2 | 2.1 Branch_2.1 | 2.2 Branch_2.2 You can simpple modify code that you will find below. I have used at simple sitemap generation. But I have problem that you need run it from subdirectory of directory that you want to display. But it is maybe my error. Have you take look at mail archive? I have that code form it (I have not in file original author, but it could be searched in archive by searching Subject: RE: [Zope] Mapping a site or search by date: Date: Wed, 25 Aug 1999 14:01:40 +1000): I have done little simplification: File SiteMap: <html><head></head><body> <!--#with aq_parent--> <!--#var SiteMap_recurse_folder--> <!--#/with--> </body></head> File SiteMap_recurse_folder: <ul> <!--#in "objectItems(['Folder', 'LinkedFolder','PortableHole'])"--> <!--xx#if "has_permission(id,AUTHENTICATED_USER)"--> <li> <a href="<dtml-var "_.getitem(id).absolute_url()">/manage"><dtml-var title_or_id></a> <small><dtml-var meta_type></small> [ <!--#if "(ZopeTime() - bobobase_modification_time()) < 2"--><b><!--#/if--> <dtml-var bobobase_modification_time fmt="%d.%m.%y %H:%M"> <!--#if "(ZopeTime() - bobobase_modification_time()) < 2"--></b><!--#/if-->] </li> <!--#with sequence-item--> <!--#var SiteMap_recurse_folder--> <!--#/with--> <!--xx#/if--> <!--#/in--> </ul> ----------------------- Simple place <dtml-let xx=sequence number> (or so) in that place: ........ <!--#with sequence-item--> <dtml-let xx=sequence number> <!--#var SiteMap_recurse_folder--> </dtml-let xx> <!--#/with--> ....... and do display number like that: ........ <dtml-var xx><dtml-var title_or_id> ..... These modificationa are not tested, but sitemap works for me fine. Of course, you can do use <ol><li> in HTML and you will get numbering at browser side. Regards JL.
participants (1)
-
Jaroslav Lukesh