0

I have created a Sails JS app. I have added favicon icon by adding following line in layout.js

<link rel="shortcut icon" href="wb-favicon.png"/>

This works for the routes like "/dashboard","/user" but not working for routes like "/reports/myreport","/user/add". In short if I use multilevel routes the favicon not showing.

Any solution?

Bonanza
  • 1,601
  • 14
  • 23
user3759750
  • 123
  • 3
  • 10
  • You need to add an absolute or relative path to the file. For example in reports/myreport page change it to href="../wb-favicon.png" and I'm guessing it will work assuming the png is located up one directory. – user2263572 Apr 06 '16 at 04:37
  • Use href="/wb-favicon.png" it will wark for all. '../' goes one level up only. '/' goes to the top. – Bonanza Apr 06 '16 at 04:49

1 Answers1

0

Changing things in layout will never work because the layout is built dynamically.What you can do is:

Rename your file wb-favicon.png to favicon.ico and remove the browsers cache and see your thing will work.Make sure you keep favicon.ico in assets directory.

vkstack
  • 1,582
  • 11
  • 24