Thanks very much!

Could you maybe point me to a plugin which implements this the way you
described? If I'd see it within an example my head could better wrap
itself around this one.

In the meantime I figured out an other way to accomplish my needs, but
I guess it is more a hack and not best practice.
I thought maybe I could return in process_request() template2.html
under the condition that req.path.info == myplugin/template2...
Do you think that there are problems with this implementation?



On May 13, 12:02 am, Steffen Hoffmann <[email protected]> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 12.05.2011 23:19, wrote mic:> My problem is that I don't know how to tell 
> trac that I have other
> > templates and that the templates get 'linkable' like myplugin/
> > template2.
> > If I get trac to know that this link should call my second template
> > I'm all set.
> > Do I have to make that all on my own in my implementation of
> > process_request()? If yes, how do I figure out which link is requested
> > at the moment?
>
> This time the question feels a bit clearer.
>
> The way I know is to 'register' templates with IRequestHandler [1] first
> method `match_request()` and deliver content with the second method
> `process_request`. Make sure to have an `ITemplateProvider` nearby, but
> you seem to already have it working for one page, right?
>
> If you want to add links like the previously mentioned context
> navigation links into other (plugins) pages, you'll need to trigger such
> an insert with `IRequestFilter` method `post_process_request()` but be
> sure to add a corresponding (almost) empty method
> `pre_process_request()` just returning the handler, or you'll most
> probably disturb processing for calls to arbitrary pages.
>
> Be sure to always tell Trac about your plugin (class) capabilities with
> the `implements`[3] clause. This is commonly hidden behind a broad
> import of everything in trac.core, but I like to be more precise, if
> feasible.
>
> > Thank you very much for your reply and attempt to help me.
>
> Oh, you're welcome. :-)
>
> Steffen Hoffmann
> (hasienda)
>
> [1] from trac.web.api import IRequestHandler
> [2] from trac.web.api import IRequestFilter
> [3] from trac.core import implements
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
> Comment: Using GnuPG with Mozilla -http://enigmail.mozdev.org/
>
> iEYEARECAAYFAk3MWPkACgkQ31DJeiZFuHcUYQCfUbPTdixYPSS43vM2QcxCiWzq
> dhUAnjxSSoacAv9ojBDsMbUwQz3GaAlf
> =BnX5
> -----END PGP SIGNATURE-----

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Development" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/trac-dev?hl=en.

Reply via email to