Ticket #648 (closed enhancement: fixed)
Opened 8 years ago
Last modified 8 years ago
hdf value for the current uri
| Reported by: | dju` | Owned by: | cmlenz |
|---|---|---|---|
| Priority: | low | Milestone: | 0.8 |
| Component: | general | Version: | 0.7.1 |
| Severity: | normal | Keywords: | |
| Cc: | |||
| Release Notes: | |||
| API Changes: | |||
Description
could source:/trunk/trac/core.py provide to cs templates a hdf value for the current request uri?
for example: HTTP.url would be "ticket/6", or "/timeline", or "/wiki/MyPage".
then it could be possible, for example in the per-site site_header.cs template, to make a menu that could dynamically hilight the page you're on. for the #proj-menu on this website, the following could be done:
<div id="proj-menu"> <ul> <li><a href="/trac/"<?cs if:HTTP.url == '/'?> class="active"<?cs /if ?>>Home</a></li> <li><a href="/trac/wiki/TracDownload"<?cs if:HTTP.url == '/wiki/TracDownload'?> class="active"<?cs /if ?>>Download</a></li> <li><a href="/trac/wiki/TracGuide"<?cs if:HTTP.url == '/wiki/TracGuide'?> class="active"<?cs /if ?>>Documentation</a></li> <li><a href="/trac/wiki/TracFaq"<?cs if:HTTP.url == '/wiki/TracFaq'?> class="active"<?cs /if ?>>FAQ</a></li> <li><a href="/trac/wiki/TracSupport"<?cs if:HTTP.url == '/wiki/TracSupport'?> class="active"<?cs /if ?>>Support</a></li> <li><a href="/trac/wiki/HowToContribute"<?cs if:HTTP.url == '/wiki/HowToContribute'?> class="active"<?cs /if ?>>Participate</a></li> <li><a href="/trac/wiki/MailingList"<?cs if:HTTP.url == '/wiki/MailingList'?> class="active"<?cs /if ?>>Mailing lists</a></li> </ul> </div>
and then use css styles to hilight the active class.
Attachments
Change History
comment:1 Changed 8 years ago by dju`
comment:2 Changed 8 years ago by daniel
- Milestone set to 0.8
putting HTTP.path_info in there should suffice.
comment:3 Changed 8 years ago by cmlenz
- Owner changed from jonas to cmlenz
- Priority changed from normal to low
- Status changed from new to assigned
comment:4 Changed 8 years ago by cmlenz
- Resolution set to fixed
- Status changed from assigned to closed
Added in [953].



obvisouly HTTP.url should contain the request uri, where the base location of trac has been stripped, for more portability.