Ok, I try to explain it again. I am developping a plugin with Trac 0.11. When I am on the webpage http://mywebsite.com/trac.cgi/myplugin, I click a button to submit a HTML form, and then the page http://mywebsite.com/trac.cgi/myplugin is displayed again. But I would like to use an anchor, and instead of to display this page from the top, I want to display it from the middle http://mywebsite.com/trac.cgi/myplugin#middle.
I put <a name="middle"><h2>Title</h2></a> in the middle of my webpage myplugin.html. But when I process the information of my form with the function "def process_request(self, req)" I have to specify the return: return 'myplugin.html', data, None " If I put 'myplugin.html#middle' I have this internal Trac error : 'TemplateNotFound: Template " myplugin.html#middle" not found'. On Dec 10, 2:29 pm, "Alec Thomas" <[EMAIL PROTECTED]> wrote: > TBH I couldn't understand what you were trying to achieve. Maybe if > you clarify that? > > It sounds vaguely like you want to do a redirect to a specific anchor > in a page. If this is the case, you want to do: req.redirect(url) > > On 10/12/2007, Vince <[EMAIL PROTECTED]> wrote: > > > > > > > Does anyone have an idea to do this ? > > > Vince wrote: > > > Hi all, > > > I am developing a plugin for Trac 0.11dev and I would like to use link > > > with anchor in my template. > > > > If I put " <a name="gohere">blablabla</a>" in my HTML template file, > > > how could I use it with a URL likehttp://lolo.com/trac.cgi/section#gohere > > > ? > > > > I tried to put in the function : > > > "def process_request(self, req) > > > ... > > > ... > > > return 'section#gohere', data, None " > > > > But I have this internal Trac error : "TemplateNotFound: Template > > > "patterns.html#displayTickets" not found" > > > > So I looked how the preview for a new ticket did it (http://www.hosted- > > > projects.com/trac/TracDemo/Demo/newticket#preview). I looked the file > > > trunk/trac/ticket/web_ui.py but I didn't find the information. The > > > function only return " return 'ticket.html', data, None" and I cannot > > > find how Trac does #preview to appear after the URL. > > > > Could anyone help me ? > > > Pingvince > > -- > Evolution: Taking care of those too stupid to take care of themselves. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Trac Users" 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-users?hl=en -~----------~----~----~----~------~----~------~--~---
