Modify ↓
Opened 20 years ago
Closed 20 years ago
#648 closed enhancement (fixed)
hdf value for the current uri
Reported by: | dju` | Owned by: | Christopher Lenz |
---|---|---|---|
Priority: | low | Milestone: | 0.8 |
Component: | general | Version: | 0.7.1 |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal 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 (0)
Change History (4)
comment:1 by , 20 years ago
comment:3 by , 20 years ago
Owner: | changed from | to
---|---|
Priority: | normal → low |
Status: | new → assigned |
Note:
See TracTickets
for help on using tickets.
obvisouly
HTTP.url
should contain the request uri, where the base location of trac has been stripped, for more portability.