wiki:CtxtnavAddPlugin

Version 2 (modified by coderanger, 9 years ago) (diff)

--

Add links to the ctxtnav bar of other plugins

Description

This plugin provides an interface (!ICtxtnavAdder) to alter the ctxtnav bar of other plugins, most notably the wiki. For those of you asking what a ctxtnav bar is, its the row of links below the main navigation bar.

Bugs/Feature Requests

Existing bugs and feature requests for CtxtnavAddPlugin are here.

If you have any issues, create a new ticket.

Download

Download the zipped source from here.

Source

You can check out CtxtnavAddPlugin from here using Subversion, or browse the source with Trac.

Example

Adding a link and a Javascript button to the Wiki:

from trac.core import *
from trac.util import Markup

from ctxtnavadd.api import ICtxtnavAdder

class ExampleModule(Component):

    implements(ICtxtnavAdder)

    # ICtxtnavAdder methods
    def match_ctxtnav_add(self, req, path_info):
        return path_info.startswith('/wiki')

    def get_ctxtnav_adds(self, req):
        yield Markup("""<a href="" onclick="alert('Test'); return false">Markup test</a>""")
        yield ('/timeline','Other test')

Recent Changes

[3416] by coderanger on 2008-03-25 07:39:08
Change my email to avoid Yahoo, which decided to brake my scraper script recently.
[2450] by coderanger on 2007-07-11 08:05:46
CtxtnavAddPlugin:

Typo on the template glob.

[2210] by coderanger on 2007-04-28 22:04:15
CtxtnavAddPlugin:

More changes from a long time ago.

Author/Contributors

Author: coderanger
Contributors: