You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Manuel Mata <ma...@yahoo.es> on 2007/01/29 19:47:25 UTC
Mapping favicon
Hi all.
I want to put a favicon on my application which is
under "abc" context, so when i write
"http://localhost:8888/abc/" it put my icon on the
left of the url if you use Firefox ( i think you know
what i mean).
I matched it with this code on my sitemap
<!-- favicon -->
<map:match pattern="favicon.ico">
<map:read mime-type="image/x-icon"
src="include/images/favicon32x32.ico"/>
</map:match>
but it doesn't work. I see that on the cocoon main
sitemap there is a matching like
'pattern="**favicon.ico"' so i think that it matches
all favicons on all requests anywhere it is and
returns the cocoon one ("resources/icons/cocoon.ico").
So i get some questions:
1. Why doesn't it match mine if it is processed first
than cocoon main matching ?
2. Is the request/respones cycle of favicon from the
browser always done to
"http://localhost:8888/favicon.ico" or
"http://localhost:8888/abc/favicon.ico" ?
If i point to "http://localhost:8888/abc/favicon.ico"
i get my icon but if point any other url mapped i get
the page but not my icon (i get the cocoon one) ...
I'm really confused with this. I hope anyone can help.
Thx in advance.
______________________________________________
LLama Gratis a cualquier PC del Mundo.
Llamadas a fijos y móviles desde 1 céntimo por minuto.
http://es.voice.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Mapping favicon
Posted by Lars Huttar <la...@sil.org>.
On 1/29/2007 12:47 PM, Manuel Mata wrote:
> Hi all.
>
> I want to put a favicon on my application which is
> under "abc" context, so when i write
> "http://localhost:8888/abc/" it put my icon on the
> left of the url if you use Firefox ( i think you know
> what i mean).
>
> I matched it with this code on my sitemap
>
> <!-- favicon -->
> <map:match pattern="favicon.ico">
> <map:read mime-type="image/x-icon"
> src="include/images/favicon32x32.ico"/>
> </map:match>
>
> but it doesn't work.
You may want to check http://en.wikipedia.org/wiki/Favicon for full info
on favicons... traditional usage and newer practice.
The basic thing to know here is that traditionally, favicons were
associated with web *servers*, not web pages, and were assumed to be at
http://hostname/favicon.ico, i.e. in the root folder (of URL space at
least).
Assuming your subsitemap is not mounted at the root folder... e.g. it's
probably mounted with a prefix such as "myapp"... your subsitemap
matcher for favicon.ico will only match
"http://hostname/myapp/favicon.ico". But your browser asks for a favicon
at "http://hostname/favicon.ico", which will not match the matcher in
your subsitemap.
> I see that on the cocoon main
> sitemap there is a matching like
> 'pattern="**favicon.ico"' so i think that it matches
> all favicons on all requests anywhere it is and
> returns the cocoon one ("resources/icons/cocoon.ico").
> So i get some questions:
>
> 1. Why doesn't it match mine if it is processed first
> than cocoon main matching ?
>
In the Cocoon top-level sitemap, which comes first: the **favicon.ico
matcher or the matcher that mounts your subsitemap?
The matcher that mounts your subsitemap may be
<map:match pattern="mount/*/**">
<map:mount check-reload="yes" src="mount/{1}/"
uri-prefix="mount/{1}"/>
</map:match>
or
<map:match pattern="*/**">
<map:mount check-reload="yes" src="{1}/" uri-prefix="{1}"/>
</map:match>
If the favicon matcher comes first, that's why any requests for favicons
end up using Cocoon's favicon instead of yours, even if the request is
for a non-root-folder favicon (e.g. "http://hostname/myapp/favicon.ico").
> 2. Is the request/respones cycle of favicon from the
> browser always done to
> "http://localhost:8888/favicon.ico" or
> "http://localhost:8888/abc/favicon.ico" ?
>
Traditionally the former. See above. But in most modern browsers, you
can add <link> elements in your html <head> to specify what URL you want
to use for the favicon.
See http://en.wikipedia.org/wiki/Favicon#Guidelines
> If i point to "http://localhost:8888/abc/favicon.ico"
> i get my icon
So you must have your subsitemap mounted before the "**favicon.ico"
matcher in the Cocoon top-level sitemap.
> but if point any other url mapped i get
> the page but not my icon (i get the cocoon one) ...
>
>
That's consistent with the above.
> I'm really confused with this. I hope anyone can help.
>
> Thx in advance.
>
Hope the above helps. If you have more questions, let us know.
Lars
>
>
> ______________________________________________
> LLama Gratis a cualquier PC del Mundo.
> Llamadas a fijos y móviles desde 1 céntimo por minuto.
> http://es.voice.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org