Why favicon not working with subfolder in app dir?
Answered
Somali posted this in #help-forum
SomaliOP
I read the documentation and it says that if I want to have all the icons in a subfolder with an extension other than .ico, then this is supported (app/*/ = app/anyfolder/anyfile) but for some reason it only works for me if the icon is located directly on top level app (app/icon.png)
and it doesn't work if I create a folder (app/icon/icon.png)
Why?
and it doesn't work if I create a folder (app/icon/icon.png)
Why?
Answered by Clown
Granularity means more control. I am pretty sure more granularity in this context means that you can more easily set different icons for different paths.
18 Replies
@Somali I read the documentation and it says that if I want to have all the icons in a subfolder with an extension other than .ico, then this is supported (app/**/* = app/anyfolder/anyfile) but for some reason it only works for me if the icon is located directly on top level app (app/icon.png)
and it doesn't work if I create a folder (app/icon/icon.png)
Why?
I think the icon is specific to wherever you create it.
So a icon in /page1 should work in /page1,/page1/page2 and so on... unless you define a separate icon in page2 and so on
So a icon in /page1 should work in /page1,/page1/page2 and so on... unless you define a separate icon in page2 and so on
Creating a icon in app directory should mean it works in all the pages
Another thing to make sure is: caching. Favicons are heavily cached. You'll need to probably clear the cache to see changes too sometimes. (Atleast that was my experience)
@Clown I think the icon is specific to wherever you create it.
So a icon in /page1 should work in /page1,/page1/page2 and so on... unless you define a separate icon in page2 and so on
SomaliOP
I don't really understand how this solves the problem
and i dont having cache, if i replace icon.png to root app its works fine
and i dont having cache, if i replace icon.png to root app its works fine
Did you not read any of what i wrote bro
@Clown Did you not read any of what i wrote bro
SomaliOP
I meant that the documentation itself describes that you can place a file anywhere if it has the name icon.(jpg|png|etc), but as you can see in my practice this does not happen.
I would not like to place 10 favicon options in the root and thereby clog up this folder
I would not like to place 10 favicon options in the root and thereby clog up this folder
Umm... am i reading the same documentation :/.
Cause it doesnt say that. Its says use icon if you need more "granularity", use favicon otherwise
Cause it doesnt say that. Its says use icon if you need more "granularity", use favicon otherwise
Anyways from what i know(i might be wrong), icons work like how i described others.
The only way i know that might be able to work with what you are trying to do is generate the icon using code. You can return the images from there as you want.
I personally dont know of any other way
The only way i know that might be able to work with what you are trying to do is generate the icon using code. You can return the images from there as you want.
I personally dont know of any other way
@Clown Umm... am i reading the same documentation :/.
Cause it doesnt say that. Its says use icon if you need more "granularity", use favicon otherwise
SomaliOP
what mean granularity in this context XD
okay if i need more 'granularity' i use icon.png and still see this paths on screenshot
okay if i need more 'granularity' i use icon.png and still see this paths on screenshot
this is only for specific page?
@Somali what mean granularity in this context XD
okay if i need more 'granularity' i use icon.png and still see this paths on screenshot
Granularity means more control. I am pretty sure more granularity in this context means that you can more easily set different icons for different paths.
Answer
Since favicons can only be set in one path, so having more granularity in that can only mean what i just said. Either way maybe try using the code generation thingy
@Clown Since favicons can only be set in one path, so having more granularity in that can only mean what i just said. Either way maybe try using the code generation thingy
SomaliOP
so i can use real image inside ImageResponce or only styles?
@Somali so i can use real image inside ImageResponce or only styles?
You can pass in any element and generate the image out of it
I haven't tried with a image but it should work. Once again make sure to remember about caching if you dont see any change.
Not sure how good of a pattern this is but either way it should get statically optimized at buildtime.
Not sure how good of a pattern this is but either way it should get statically optimized at buildtime.