bloodhound-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Saint Germain <saint...@gmail.com>
Subject Re: Use customized configuration variable in templates
Date Wed, 18 Jun 2014 08:27:32 GMT
On 17 June 2014 03:43, Saint Germain <saintger@gmail.com> wrote:
> On Mon, 16 Jun 2014 10:25:45 -0400, Olemis Lang <olemis@gmail.com>
> wrote :
>
>> On Mon, Jun 16, 2014 at 9:57 AM, Saint Germain <saintger@gmail.com>
>> wrote:
>>
>> > On 16 June 2014 15:36, Olemis Lang <olemis@gmail.com> wrote:
>> > >
>> > > Maybe you just need to implement IRequestFilter and invoke
>> > > trac.chrome.add_script or trac.chrome.add_script_data .
>> > >
>> >
>> > That sounds very interesting !
>> > Do you have some examples on how we should use these API ?
>> >
>> >
>> >
>> [...]
>>
>> Described in these links
>>
>> http://trac.edgewall.org/browser/trunk/trac/web/api.py?marks=96-134#L96
>> http://trac.edgewall.org/browser/trunk/trac/web/chrome.py?marks=148-168#L148
>>
>
> Hello Olemis,
>
> Well I have tried creating my first plugin and failed miserably.
>
[snip]
>
> However it's driving me crazy because the hw/hello.js is called but I always got a 404
error.
>
> Is there something I am doing wrong here ?
>

I found the mistake: I forgot to declare the interface ITemplateProvider.

So I managed to create my first plugin by using ITemplateStreamFilter
and self.env.config.get to retrieve the value from the config file (I
don't know if this is the proper way to do this, but it works
http://trac-hacks.org/ticket/9256).

Thanks for the tips !

Mime
View raw message