Modify

Opened 6 years ago

Last modified 12 months ago

#3632 assigned enhancement

provide or document ways to use variables in custom items

Reported by: kussmaul Owned by: rjollos
Priority: low Component: NavAddPlugin
Severity: trivial Keywords:
Cc: clif@…, rjollos Trac Release: 0.11

Description

It would be very nice for custom menu items to be able to variables, such as the current user, the current wiki topic, ticket number, etc.

Please consider adding this, or documenting examples of how to do it.

Attachments (0)

Change History (5)

comment:1 Changed 6 years ago by otaku42

I'm not sure I understand what you request. Can you please describe a more detailed description of your idea?

comment:2 Changed 6 years ago by kussmaul

I want to create custom menu items with titles or URLs that are not completely static, but depend on other information in trac, such as the current user, current topic, current ticket number, etc. This would add considerable power & flexibility.

For example, we could create custom menu items to:

  • custom query showing tickets for the current user

mytickets.title = Tickets for $USER mytickets.url = .../query?owner=$USER

  • actions for the current wiki page:

pageattach.title = Attach pageattach.urk = .../wiki/$PAGE?action=attach pagedelete.title = Delete pagedelete.urk = .../wiki/$PAGE?action=delete pageedit.title = Edit pageedit.url = .../wiki/$PAGE?action=edit

  • actions for the current ticket

samecomp.title = Same Component samecomp.url = .../query?component=$COMPONENT samemile.title = Same Milestone samemile.url = .../query?milestone=$MILESTONE

comment:3 Changed 6 years ago by kussmaul

Sorry - I didn't preview and Trac mangled the formatting. Second try:

  • custom query showing tickets for the current user
    • mytickets.title = Tickets for $USER
    • mytickets.url = .../query?owner=$USER
  • actions for the current wiki page:
    • pageattach.title = Attach
    • pageattach.url = .../wiki/$PAGE?action=attach
    • pagedelete.title = Delete
    • pagedelete.url = .../wiki/$PAGE?action=delete
    • pageedit.title = Edit
    • pageedit.url = .../wiki/$PAGE?action=edit
  • actions for the current ticket
    • samecomp.title = Same Component
    • samecomp.url = .../query?component=$COMPONENT
    • samemile.title = Same Milestone
    • samemile.url = .../query?milestone=$MILESTONE

comment:4 Changed 5 years ago by rjollos

  • Cc rjollos added

comment:5 Changed 12 months ago by rjollos

  • Owner changed from otaku42 to rjollos
  • Status changed from new to assigned

Add Comment

Modify Ticket

Action
as assigned The owner will remain rjollos.
Author


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

 
Note: See TracTickets for help on using tickets.