On Oct 26, 2008, at 4:16 PM, Thomas Vander Stichele wrote: > > On Sun, 2008-10-26 at 07:24 -0700, Martin S. wrote: >> I'm not an expert for this, but I think it's now done using the class >> IRequestFilter. >> I don't know If this works also for macros or only for plugins, > > I doubt it, but I will give it a shot. >> but I >> used code like below to add a new >> javascript file to the header in a recent plugin of mine. Maybe there >> is also a 'add_link' function. > > Yes, I found the add_link method in web.chrome > > However, it seems that: > - chrome gets created with a fake request object in prepare_request > - this method invokes add_link to add all of the <head> elements > - render_template then resets them, and creates late_links > - when my macro gets executed, the formatter has the 'real' Request > object, which is not the one the template is filled with. > > I can't say I understand the page processing model much in 0.11, so > could anyone shed some light on what's going on here ?
You cannot add things to <head> in a macro, as they are rendered too late in the process. You could do some interesting stuff with string scanning and a request filter though. --Noah --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
