[Moin-user] I want a "changing logo" - browser cache problem

Sebastian Haase sebastian.haase at mdc-berlin.de
Fri Jun 22 05:43:11 EDT 2007


Now it works !
I changed *only* in wikiconfig.py and used this javascript code.
Of course -now every page requests reload the logo - but it's small...

    logo_string = '''<script type="text/javascript">
d = new Date().getTime();
document.write('<img src="/wiki/mylogo.jpg?d='+d+'" alt="logo">');
</script>
<noscript><img src="/wiki/mylogo.jpg" alt="logo"></noscript>
'''


Thanks for the help.
-Sebastian

On 6/22/07, Sebastian Haase <sebastian.haase at mdc-berlin.de> wrote:
> On 6/21/07, Henryk Gerlach <hgerlach at gmx.de> wrote:
> > > > I was thinking about this solution -- but how !?
> > >
> > > The header and footer config vars can contain python code, so if you
> > > implement your stuff there, you could change the value of your logo
> > > configuration. The python code needed could be directly entered into
> > > wikiconfig.
> >
> > So Thomas sugessts putting somethin like
> >
> >     import random
> >     pics=[u"http://xyz.de/a.png", u"http://xyz.de/b.png"]
> >     logo_string= u'<img src="' + random.choice(pics,1) + u'" />'
> >
> > in your wikiconfig instead of
> >     logo_string= u'<img src="fixed.png" />'
> >
> >
> > Cheers,
> >    Henryk
> > --
>
> Thanks - I tried something like this -- but it turns out that the
> wikiconfig is of course only evaluated once -- so I would have to
> restart the wiki-engine every time I change the logo ... don't like
> that ...
>
> -Sebastian
>




More information about the Moin-user mailing list