Edgewall Software

Opened 18 years ago

Closed 18 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:


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">
  <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>

and then use css styles to hilight the active class.

Attachments (0)

Change History (4)

comment:1 by dju`, 18 years ago

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

comment:2 by daniel, 18 years ago

Milestone: 0.8

putting HTTP.path_info in there should suffice.

comment:3 by Christopher Lenz, 18 years ago

Owner: changed from Jonas Borgström to Christopher Lenz
Priority: normallow
Status: newassigned

comment:4 by Christopher Lenz, 18 years ago

Resolution: fixed
Status: assignedclosed

Added in [953].

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Christopher Lenz.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christopher Lenz to the specified user.

Add Comment

E-mail address and name can be saved in the Preferences .
Note: See TracTickets for help on using tickets.