Opened 8 years ago

Closed 2 years ago

#6850 closed defect (worksforme)

[PATCH] add relative url support

Reported by: Rémi Demarthe Owned by: Ryan J Ollos
Priority: normal Component: BackLinksMacro
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description (last modified by Ryan J Ollos)


This snippet permit to have the right URL link.

> from trac.resource import get_relative_url
<                 buf.write('<li><a href="%s">' %[0]))
>                 if row[0].find(":") >= 0 or row[0].startswith("/"):
>                     link =[0])
>                 else:
>                     # Support relative paths; based on trac/wiki/
>                     link = get_relative_url(self.env, formatter.resource(id=row[0]), formatter.href)
>                 buf.write('<li><a href="%s">' % link )

Attachments (0)

Change History (4)

comment:1 Changed 6 years ago by Ryan J Ollos

Component: BackLinksMenuMacroBackLinksMacro

The functionality of BackLinksMenuMacro is being integrated into the BackLinksMacro.

comment:2 Changed 2 years ago by Ryan J Ollos

Description: modified (diff)
Owner: changed from Trap to Ryan J Ollos
Status: newaccepted

comment:3 Changed 2 years ago by Ryan J Ollos

I'm unsure of what this change is trying to accomplish, so I'll assume it's not relevant to the current codebase.

comment:4 Changed 2 years ago by Ryan J Ollos

Resolution: worksforme
Status: acceptedclosed

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.