Opened 7 years ago

Closed 13 months ago

#6850 closed defect (worksforme)

[PATCH] add relative url support

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

Description (last modified by rjollos)


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 4 years ago by rjollos

  • Component changed from BackLinksMenuMacro to BackLinksMacro

The functionality of BackLinksMenuMacro is being integrated into the BackLinksMacro.

comment:2 Changed 13 months ago by rjollos

  • Description modified (diff)
  • Owner changed from trapanator to rjollos
  • Status changed from new to accepted

comment:3 Changed 13 months ago by rjollos

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 13 months ago by rjollos

  • Resolution set to worksforme
  • Status changed from accepted to closed

Add Comment

Modify Ticket

as closed The owner will remain rjollos.
The resolution will be deleted. Next status will be 'reopened'.

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

Note: See TracTickets for help on using tickets.