Hello Dirk,
Sorry for the late answer, I had a busy week ;-)
On 9/17/2010 11:32 PM, Dirk Stöcker wrote:
Hello,
I have two development questions, where my knowledge is missing:
1) I want to add new links to a page:
Currently I have in the tmeplate file:
<div class="nav">
${prevnext_nav('Page')}
</div>
and in code:
add_link(req, 'prev', req.href.admin(cat, page, page=pagenum,
num=pagesize), 'Previous Page')
add_link(req, 'next', req.href.admin(cat, page, page=pagenum+2,
num=pagesize), 'Next Page')
I now want up to 4 additional links in front of the prev links:
add_link(req, '15', req.href.admin(cat, page, page=num15, num=15), '15')
add_link(req, '25', req.href.admin(cat, page, page=num25, num=25), '25')
add_link(req, '50', req.href.admin(cat, page, page=num25, num=50), '50')
add_link(req, '100', req.href.admin(cat, page, page=num25, num=100),
'100')
What do I need to add in template to get this done?
You should use add_ctxtnav rather than add_link.
The latter is specifically for adding <link> elements in addition to <a>
links, so with a conventional meaning for the rel attribute, like
"prev", "next", etc., not "15", see trac/templates/layout.html.
prevnext_nav is a helper function for easily adding such "prev", "next"
(and optionally "up") links.
But the former (i.e. add_ctxtnav) is for adding arbitrary <a> links in
the "contextual links" area (top right below the main nav bar, in the
default layout).
2) I use authentication plugin with a htpasswd file. Now I have a
case, where a Java applet is used which works fine when logged in
previously. But I want the plugin to allow login. What do I need to do
to take the basic authentication send by the plugin and convert it
into a proper login for trac? This is site specific, so I can rely on
authentication plugin being installed.
Sorry, no idea for this one...
-- Christian
--
You received this message because you are subscribed to the Google Groups "Trac
Development" group.
To post to this group, send email to trac-...@googlegroups.com.
To unsubscribe from this group, send email to
trac-dev+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/trac-dev?hl=en.