Re: [Rest2web-develop] Section headers
Brought to you by:
mjfoord
From: martin f k. <ma...@ma...> - 2006-08-05 12:58:35
|
also sprach Michael Foord <mi...@pc...> [2006.08.05.1245 +0100]: > martin f krafft wrote: > >also sprach Michael Foord <mi...@pc...> [2006.08.05.1158 +0100]: > > =20 > >>Yes indextree['parent'] is always None. > >> =20 > > > >Ok. > > > > =20 > >>I *think* I see what you want to do. You want a single index page > >>which only shows pages from the selected section. I could probably > >>achieve that with javascript, but I wouldn't know how to do it > >>with CSS. :-) > >> =20 > > > >No no, much easier. I simply want a list of categories (let's not > >call them sections) as defined in the root, to show up on all pages > >of the site. I want one of those categories to be hilighted, > >depending on where we are in the site. > > > > =20 > Does your site have many directories ? No. > >Pseudocode: > > > > def current_url_matches_category(page, cat): > > // ... > > > > print '<ol id=3D"globalsect">' > > for cat in indextree['categories']: > > if current_url_matches_category(page, cat): > > print '<li class=3D"current">' + cat['link title'] + '</li>' > > else: > > print '<li><a href=3D"%s">%s</a></li>' % (cat['base_url'],=20 > > cat['link_title']) > > > > =20 > By current URL you mean the current page being rendered I assume. Yes. > You can get the 'category' of the current page from : >=20 > thispage['section'] Well, I understand sections to be per directory. My "categories" need to be site-wide. > So assuming every directory has the same categories, your code above=20 > should be fairly simple... >=20 > Could you try again with the sourceforge mailing list ? Done. Thus not trimming. I am now running up against a new problem, testing: $ r2w [...] Building contact.html [...] Processing "sub" directory. $ mkdir foo $ cp contact.txt foo/bar.txt $ r2w [...] Building contact.html Skipping "contact.html". Identical file exists. [...] Processing "foo" directory. Processing "sub" directory. [...] It's just ignoring the foo/bar.txt file... --=20 martin; (greetings from the heart of the sun.) \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck =20 spamtraps: mad...@ma... =20 philosophy: unintelligible answers to insoluble problems. |