Re: Adding favicons to Lenya RELEASE_2_0_4

Emyr Tomos <[email protected]> Fri, 5 Oct 2012 12:24:36 +0100
Newsgroups gmane.comp.cms.lenya.user
Message-ID <CAE0JWYo9z1Xv7XFx4RAfqywjejA3NQz60y1aerwY++JfOChzsQ@mail.gmail.com>
--f46d04446a49efe34a04cb4e1d71
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi Rainer,
Thanks for your reply, sorry I didn't respond earlier.
I am convinced from looking at my error logs that the lenya fallback
mechanism, in the case of favicons, is failing to include the "images"
folder in the filesystem path when it's looking for the file. the reason i
keep getting the lenya icon is not because lenya is falling back to that -
it fails to find that also - but because /favicon.ico works, and the
venerable old method that microsoft first introduced comes into play.
Interestingly when I wget to a static site this problem disappears, but
even if it didn't we will be either serving statically or frontending with
apache so we can ensure there is a correct favicon.ico in the docroot of
each virtual host. Since spending a vast amount of time on this would leave
my employers wondering at the wisdom of my choice of lenya, i have deferred
this indefinitely (i.e until nothing else needs doing :-D) but if ii pick
it up again i'll let you know what i find.

tx again,
regards
em


On Tue, Oct 2, 2012 at 8:01 PM, Rainer Sch=F6pf <[email protected]>wro=
te:

> On Tue, 2 Oct 2012 at 18:34 +0100, Emyr Tomos wrote:
>
>  > I have tried everything to gain control over the favicons in lenya
>  > with no success. The normal masking behaviour per publication has not
>  > worked, and I have followed the instructions here :
>  >
> http://markmail.org/message/37zfk5pxa6wevhvt#query:+page:1+mid:37zfk5pxa6=
wevhvt+state:results
>  > with no success
>  > basically I added
>  >         <link rel=3D"SHORTCUT ICON" type=3D"image/x-icon"
>  > href=3D"{$root}/images/colet.ico"/>
>  > to the publication page2xhtml.xsl and added
>  >       <map:match pattern=3D"*/*/**colet.ico">
>  >         <map:read src=3D"pubs/{1}resources/shared/favicon.ico"
>
> There is a "/" missing immediately after "{1}", ie.
>
>  <map:read src=3D"pubs/{1}/resources/shared/favicon.ico"
> mime-type=3D"image/x-icon"/>
>
> You should use the fallback: protocol anyway. This will first look inside
> the
> publication directory and then in the global resources directory.
>
>  > I have also looked at
>  >
> http://lenya.apache.org/docu20/standardmodules/resourcemodulesection/reso=
urcemoduleoverview.html#N10085
>  > , and at the Wyona website, but there is nothing there to say how to
>  > make them directly addressable as part of a publication.
>
> Here is what I do: add a case for files with a names like *.ico to the
> resources-shared.xmap:
>
>          <!-- matches pub-id/area/images/*.ico -->
>       <map:match pattern=3D"*/*/images/*.ico">
>         <map:read src=3D"fallback://resources/shared/images/{3}.ico"
> mime-type=3D"image/x-icon" />
>       </map:match>
>
> (Note: I did this in the resources.xmap file for the publication in
> question,
> ie.
>
>   .../pubs/pub_name/lenya/resources-shared.xmap
>
> but it will work in the global resources-shared.xmap file as well.)
>
> Put the favicon into the images directory, e.g.,
>
>   .../pubs/pub_name/resources/shared/images/myicon.ico
>
> and reference it via
>
>   <LINK href=3D"http://www.dante.de/images/myicon.ico" type=3D"image/ico"
> rel=3D"SHORTCUT ICON">
>
>   Rainer
>

--f46d04446a49efe34a04cb4e1d71
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi Rainer,<div>Thanks for your reply, sorry I didn&#39;t respond earlier.=
=A0</div><div>I am convinced from looking at my error logs that the lenya f=
allback mechanism, in the case of favicons, is failing to include the &quot=
;images&quot; folder in the filesystem path when it&#39;s looking for the f=
ile. the reason i keep getting the lenya icon is not because lenya is falli=
ng back to that - it fails to find that also - but because /favicon.ico wor=
ks, and the venerable old method that microsoft first introduced comes into=
 play.=A0</div>
<div>Interestingly when I wget to a static site this problem disappears, bu=
t even if it didn&#39;t we will be either serving statically or frontending=
 with apache so we can ensure there is a correct favicon.ico in the docroot=
 of each virtual host. Since spending a vast amount of time on this would l=
eave my employers wondering at the wisdom of my choice of lenya, i have def=
erred this indefinitely (i.e until nothing else needs doing :-D) but if ii =
pick it up again i&#39;ll let you know what i find.=A0</div>
<div><br></div><div>tx again,=A0</div><div>regards</div><div>em</div><div><=
br><br><div class=3D"gmail_quote">On Tue, Oct 2, 2012 at 8:01 PM, Rainer Sc=
h=F6pf <span dir=3D"ltr">&lt;<a href=3D"mailto:[email protected]" targ=
et=3D"_blank">[email protected]</a>&gt;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div class=3D"im">On Tue, 2 Oct 2012 at 18:3=
4 +0100, Emyr Tomos wrote:<br>
<br>
=A0&gt; I have tried everything to gain control over the favicons in lenya<=
br>
=A0&gt; with no success. The normal masking behaviour per publication has n=
ot<br>
=A0&gt; worked, and I have followed the instructions here :<br>
=A0&gt; <a href=3D"http://markmail.org/message/37zfk5pxa6wevhvt#query:+page=
:1+mid:37zfk5pxa6wevhvt+state:results" target=3D"_blank">http://markmail.or=
g/message/37zfk5pxa6wevhvt#query:+page:1+mid:37zfk5pxa6wevhvt+state:results=
</a><br>

=A0&gt; with no success<br>
=A0&gt; basically I added<br>
=A0&gt; =A0 =A0 =A0 =A0 &lt;link rel=3D&quot;SHORTCUT ICON&quot; type=3D&qu=
ot;image/x-icon&quot;<br>
=A0&gt; href=3D&quot;{$root}/images/colet.ico&quot;/&gt;<br>
=A0&gt; to the publication page2xhtml.xsl and added<br>
=A0&gt; =A0 =A0 =A0 &lt;map:match pattern=3D&quot;*/*/**colet.ico&quot;&gt;=
<br>
=A0&gt; =A0 =A0 =A0 =A0 &lt;map:read src=3D&quot;pubs/{1}resources/shared/f=
avicon.ico&quot;<br>
<br>
</div>There is a &quot;/&quot; missing immediately after &quot;{1}&quot;, i=
e.<br>
<br>
=A0&lt;map:read src=3D&quot;pubs/{1}/resources/shared/favicon.ico&quot; mim=
e-type=3D&quot;image/x-icon&quot;/&gt;<br>
<br>
You should use the fallback: protocol anyway. This will first look inside t=
he<br>
publication directory and then in the global resources directory.<br>
<div class=3D"im"><br>
=A0&gt; I have also looked at<br>
=A0&gt; <a href=3D"http://lenya.apache.org/docu20/standardmodules/resourcem=
odulesection/resourcemoduleoverview.html#N10085" target=3D"_blank">http://l=
enya.apache.org/docu20/standardmodules/resourcemodulesection/resourcemodule=
overview.html#N10085</a><br>

=A0&gt; , and at the Wyona website, but there is nothing there to say how t=
o<br>
=A0&gt; make them directly addressable as part of a publication.<br>
<br>
</div>Here is what I do: add a case for files with a names like *.ico to th=
e<br>
resources-shared.xmap:<br>
<br>
=A0 =A0 =A0 =A0 =A0&lt;!-- matches pub-id/area/images/*.ico --&gt;<br>
=A0 =A0 =A0 &lt;map:match pattern=3D&quot;*/*/images/*.ico&quot;&gt;<br>
=A0 =A0 =A0 =A0 &lt;map:read src=3D&quot;fallback://resources/shared/images=
/{3}.ico&quot; mime-type=3D&quot;image/x-icon&quot; /&gt;<br>
=A0 =A0 =A0 &lt;/map:match&gt;<br>
<br>
(Note: I did this in the resources.xmap file for the publication in questio=
n,<br>
ie.<br>
<br>
=A0 .../pubs/pub_name/lenya/resources-shared.xmap<br>
<br>
but it will work in the global resources-shared.xmap file as well.)<br>
<br>
Put the favicon into the images directory, e.g.,<br>
<br>
=A0 .../pubs/pub_name/resources/shared/images/myicon.ico<br>
<br>
and reference it via<br>
<br>
=A0 &lt;LINK href=3D&quot;<a href=3D"http://www.dante.de/images/myicon.ico"=
 target=3D"_blank">http://www.dante.de/images/myicon.ico</a>&quot; type=3D&=
quot;image/ico&quot; rel=3D&quot;SHORTCUT ICON&quot;&gt;<br>
<span class=3D"HOEnZb"><font color=3D"#888888"><br>
=A0 Rainer<br>
</font></span></blockquote></div><br></div>

--f46d04446a49efe34a04cb4e1d71--