开发者

Changing the favicon in Drupal

开发者 https://www.devze.com 2023-02-25 08:02 出处:网络
I have uploaded a new favicon onto a Drupal site, cleared my cache, and it is still showing as the drip icon, It only displays the custom icon when I am logged in and in the back end.

I have uploaded a new favicon onto a Drupal site, cleared my cache, and it is still showing as the drip icon, It only displays the custom icon when I am logged in and in the back end.

I have tried on firefox 4 and IE 8

Thanks for your help!

Update - HTML Header code added below.

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Home | CIOB</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<link rel="shortcut icon" href="/misc/favicon.ico" type="image/x-icon" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/admin_menu/admin_menu.css?d" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/ciob.org.uk/files/ctools/css/8df0ab71786aec38c5eef01816622257.css?d" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/node/node.css?d" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/system/defaults.css?d" />

<link type="text/css" rel="stylesheet" media="all" href="/modules/system/system.css?d" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/system/system-menus.css?d" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/user/user.css?d" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/cck/theme/content-module.css?d" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/ctools/css/ctools.css?d" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/date/date.css?d" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/filefield/filefield.css?d" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/lightbox2/css/lightbox.css?d" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/panels/css/panels.css?d" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/admin/toolbar/admin_toolbar.css?d" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/calendar/calendar.css?d" />
<link type="text/css" rel="stylesheet" media="all" href="/misc/farbtastic/farbtastic.css?d" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/views/css/views.css?d" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/panels/plugins/layouts/flexible/flexible.css?d" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/themes/ciob/styles/framework/reset.css?d" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/themes/ciob/styles/framework/text.css?d" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/themes/ciob/styles/framework/960.css?d" />

<link type="text/css" rel="stylesheet" media="all" href="/sites/all/themes/ciob/styles/framework/debug.css?d" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/themes/ciob/styles/styles.css?d" />
<script type="text/javascript" src="/misc/jquery.js?d"></script>
<script type="text/javascript" src="/misc/drupal.js?d"></script>
<script type="text/javascript" defer="defer" src="/sites/all/modules/admin_menu/admin_menu.js?d"></script>
<script type="text/javascript" src="/sites/all/modules/lightbox2/js/lightbox_video.js?d"></script>
<script type="text/javascript" src="/sites/all/modules/lightbox2/js/lightbox.js?d"> </script>
<script type="text/javascript" src="/sites/all/modules/panels/js/panels.js?d"></script>
<script type="text/javascript" src="/sites/all/modules/poormanscron/poormanscron.js?d"</script>

<script type="text/javascript" src="/sites/all/modules/admin/toolbar/admin_toolbar.js?d"></script>
<script type="text/javascript" src="/sites/all/themes/ciob/bookmark.js?d"></script>
<script type="text/javascript" src="/sites/all/themes/ciob/ciob.js?d"></script>
<script type="text/javascript" src="/sites/all/themes/ciob/ui.core.js?d"></script>
<script type="text/javascript" src="/sites/all/themes/ciob/ui.tabs.js?d"></script>
<script type="text/javascript">
<!--//--><![CDATA[//><!--
jQuery.extend(Drupal.settings, { "basePath": "/", "admin_menu": { "margin_top": 1, "position_fixed": 1 }, "CTools": { "pageId": "page-7f4aa01928040cccbbe2bef65e92817b" }, "googleanalytics": { "trackOutgoing": 1, "trackMailto": 1, "trackDownload": 1, "trackDownloadExtensions": "7z|aac|avi|csv|doc|exe|flv|gif|gz|jpe?g|js|mp(3|4|e?g)|mov|pdf|phps|png|ppt|rar|sit|tar|torrent|txt|wma|wmv|xls|xml|zip" }, "lightbox2": { "rtl": 0, "file_path": "/(\\w\\w/)sites/ciob.org.uk/files", "default_image": "/sites/all/modules/lightbox2/images/brokenimage.jpg", "border_size": "10", "font_color": "000", "box_color": "fff", "top_position": "", "overlay_opacity": "0.8", "overlay_color": "000", "disable_close_click": 1, "resize_sequence": "0", "resize_speed": 400, "fade_in_speed": 400, "slide_down_speed": 600, "use_alt_layout": 0, "disable_resize": 0, "disable_zoom": 0, "force_show_nav": 0, "loop_items": 0, "node_link_text": "View Image Details", "node_link_target": 0, "image_count": "Image !current of !total", "video_count": "Video !current of !total", "page_count": "Page !current of !total", "lite_press_x_close": "press \x3ca href=\"#\" onclick=\"hideLightbox();开发者_运维技巧 return FALSE;\"\x3e\x3ckbd\x3ex\x3c/kbd\x3e\x3c/a\x3e to close", "download_link_text": "Download Original", "enable_login": false, "enable_contact": false, "keys_close": "c x 27", "keys_previous": "p 37", "keys_next": "n 39", "keys_zoom": "z", "keys_play_pause": "32", "display_image_size": "", "image_node_sizes": "()", "trigger_lightbox_classes": "", "trigger_lightbox_group_classes": "", "trigger_slideshow_classes": "", "trigger_lightframe_classes": "", "trigger_lightframe_group_classes": "", "custom_class_handler": 0, "custom_trigger_classes": "", "disable_for_gallery_lists": true, "disable_for_acidfree_gallery_lists": true, "enable_acidfree_videos": true, "slideshow_interval": 5000, "slideshow_automatic_start": true, "slideshow_automatic_exit": true, "show_play_pause": true, "pause_on_next_click": false, "pause_on_previous_click": true, "loop_slides": false, "iframe_width": 600, "iframe_height": 400, "iframe_border": 1, "enable_video": 1, "flvPlayer": "/flvplayer.swf", "flvFlashvars": "" }, "cron": { "basePath": "/poormanscron", "runNext": 1303116980 } });
//--><!]]>
</script>

<!--[if lte IE 6]>
<link rel="stylesheet" href="/sites/all/themes/ciob/styles/ie6.css" type="text/css" />
<script type="text/javascript"> 
  $(document).ready(function(){ 
      $(document).pngFix(); 
  }); 
</script>


<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" href="/sites/all/themes/ciob/styles/ie7.css" type="text/css" />
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" href="/sites/all/themes/ciob/styles/ie8.css" type="text/css" />
<![endif]-->
</head>


As you can see, the HTML points to the default favicon: <link rel="shortcut icon" href="/misc/favicon.ico" type="image/x-icon" />

Drupal will not overwrite that, but will upload your custom favicon to "files/...." and then change the HTML to use that.

Your HTML was not changed. That can mean one of two things:

  1. The favicon was not uploaded correctly, Drupal got some error and did not change it.
  2. The favicon was uploaded correctly, but your theme has the default location hardcoded.

I suspect the latter. Your theme's page.tpl.php files should include <?php print $header ?> instead of the hardcoded <link rel="shortcut icon" ....


Mostly for those having the same issue where the favicon is displayed in the admin pages, but is not showing on the front pages:

  • make sure you not only change the favicon in the global theme settings but also change the favicon in the settings for your active theme (Appearance > Settings > Click on your theme name)


In my case it was using the favicon icon setted bij the opengraph meta property instead of the link rel shortcut icon. Eg. It depends on the browser you are using though. So make sure you are setting both correct in your META module and theme settings.


Changing Favicon icon in Drupal

Change the favicon in the settings of your active theme.

Go to Appearance > Your theme Settings > And unchecked (Use the default shortcut icon supplied by the theme) then upload your favicon icon and save.

0

精彩评论

暂无评论...
验证码 换一张
取 消