#940 closed enhancement (fixed)
Allow URLs relative to project root
Reported by: | anonymous | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Component: | NavAddPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.10 |
Description
When hosting several projects on the same server, there is no way currently to add a button through the global trac.ini that will point to a URL relative to each project.
E.g. for one project it would end up pointing to http://domain.com/proj1/report/1, but on the next to http://domain.com/proj2/report/1
Attachments (1)
Change History (9)
comment:1 Changed 16 years ago by
comment:2 Changed 15 years ago by
This was fairly simple. I've added a patch that makes all URLs relative to the project's root URL.
comment:3 Changed 13 years ago by
The attachment:path-relative.patch does not work if url is an absolute URL.
For example, if url = "http://www.example..."
, it would turn into something like url = "http://my.trac.com/myproj/http://www.example..."
.
I think it should check for '/' that indicate the root path of the project. Here's my simple fix:
if url[0] == '/': url = self.env.href() + url
comment:4 Changed 11 years ago by
Owner: | changed from Michael Renzmann to Ryan J Ollos |
---|---|
Status: | new → assigned |
comment:6 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Yes, this would be useful.
For instance I'd like to add a direct link to the query module to the bar. But if I enter '/query', it says "Environment not found."