You more or less understood my question correctly. Your answers helped
a lot. I have one last missing piece of the puzzle, though.
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?

Thank you very much for your reply and attempt to help me.


On May 12, 9:47 pm, Steffen Hoffmann <[email protected]> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 12.05.2011 19:49, wrote mic:> I'm currently writing a plug-in for Trac and 
> I have a question
> > regarding setting links in the plug-in:
> > The plug-in is in a new mainnav-tab and its template is shown in the
> > correct way. On the html-site of the plugin I have html-elements that
> > should link to other templates.
> > I want that the new html-template is integrated in the rest of the
> > trac environment (under the plug-in-tab)
>
> > I have seen another Plug-in which uses add_ctxtnav(req, 'bla',
> > req.href.bla("/bla_reports")) to link to other templates. I want
> > basically a similar behavior but with the normal <a href=""> links.
>
> This paragraph sounds like a different story. You'll need to prepare
> link targets from a Href object like `req.href` and inject them into
> your template as variable data (i.e. as part of the dict(data). See
> existing plugins code or Trac source documentation on the Href object
> itself here:
>  http://trac.edgewall.org/browser//trunk/trac/web/href.py#L22
>
> > Is my question understandable?
>
> I fear, No. I only assume, that you mean the new template page should
> integrate well with the navigation and all the other stuff surrounding
> Trac content normally.
>
> > How can I implement this?
>
> The key to get your rendered template(s) properly embedded into the
> web-ui are some include statements in the template header, so it looks
> like so:
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
>         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
> <html xmlns="http://www.w3.org/1999/xhtml";
>       xmlns:xi="http://www.w3.org/2001/XInclude";
>       xmlns:py="http://genshi.edgewall.org/";
>       xmlns:i18n="http://genshi.edgewall.org/i18n";
>       i18n:domain="myplugin">
>   <xi:include href="layout.html"/>
>   <xi:include href="macros.html"/>
>   <head>
> ...
>
> Hope, this helps; or you'll need to make your point a little clearer...
>
> Yours,
>
> Steffen Hoffmann
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
> Comment: Using GnuPG with Mozilla -http://enigmail.mozdev.org/
>
> iEYEARECAAYFAk3MOVUACgkQ31DJeiZFuHfhSACfcQNL7GqqQjc1gDw8kgwCflbj
> jPgAniMgw+iFnx67grGGhYg1d9hLsmki
> =rET8
> -----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