s-t
s-t

Reputation: 395

How to change favicon in CKAN

I am having trouble with this seemingly simple task.. Can someone help please?

I have uploaded .ico file to /usr/lib/ckan/default/src/custom_theme/ckanext/custom_theme/public

Changed value in setting file (development.ini) Tried making base.html for the custom theme, with

{% ckan_extends %}
{% block links -%}
   <link rel="shortcut icon" href="http://site.address/favicon.ico" />
{% endblock -%}

For file path, I have tried both relative and literal.

I can access the icon file if I type in address of it in web browser.

Upvotes: 1

Views: 1349

Answers (3)

Umar Saeed Cheema
Umar Saeed Cheema

Reputation: 1

For CKAN 2.10 and using Docker

  1. Place the favicon in your theme: src/ckanext-theme/ckanext/theme/public/base/images/ckan.ico

  2. Inside your ckan.ini file in container ( you have to exec into it), change the path of ckan.favicon to the path where you created the favicon in your extension.

  3. Re run the containers

Upvotes: 0

osedok
osedok

Reputation: 81

In CKAN 2.9.0 replace /usr/lib/ckan/default/src/ckan/ckan/public/base/images/ckan.ico with your ICO file.

Assuming you have: ckan.favicon = /base/images/ckan.ico in your ckan.ini

Refresh your browser.

Upvotes: 0

Mat K. Witts
Mat K. Witts

Reputation: 173

This is what works for me*:

  1. Define favicon filename in your .ini eg. ckan.favicon = favicon.ico
  2. Upload file to ../ckan/default/src/ckanext-[your_theme]/ckanext/[your_theme]/public
  3. Reload apache
  4. Clear Browser cache
  5. Reload site in Browser

This assumes CKAN >2.5 and following instruction on creating a custom theme

  • No need to change the base.html file in custom theme.

Upvotes: 6

Related Questions