更改 Drupal 中的图标

发布于 2024-11-02 04:21:32 字数 7091 浏览 1 评论 0 原文

我已将新的图标上传到 Drupal 站点,清除了缓存,但它仍然显示为滴水图标,它仅在我登录时在后端显示自定义图标。

我已经尝试过 Firefox 4 和 IE 8

感谢您的帮助!

更新 - 下面添加了 HTML 标头代码。

<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>

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>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

败给现实 2024-11-09 04:21:32

如您所见,HTML 指向默认的图标:

Drupal 不会覆盖它,但会将您的自定义图标上传到“files/....”,然后更改 HTML 以使用它。

您的 HTML 未更改。这可能意味着以下两件事之一:

  1. favicon 未正确上传,Drupal 出现一些错误并且没有更改它。
  2. 图标已正确上传,但您的主题对默认位置进行了硬编码。

我怀疑是后者。您主题的 page.tpl.php 文件应包含 而不是硬编码的

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" ....

呆头 2024-11-09 04:21:32

主要针对那些遇到同样问题的人,即网站图标显示在管理页面中,但未显示在首页上:

  • 确保您不仅在全局主题设置中更改网站图标,而且还在设置中更改网站图标对于您的活动主题(外观 > 设置 > 单击您的主题名称)

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)
捂风挽笑 2024-11-09 04:21:32

就我而言,它使用的是 opengraph 元属性设置的 favicon 图标,而不是 link rel 快捷方式图标。
例如。

但这取决于您使用的浏览器。
因此,请确保您在 META 模块和主题设置中设置正确。

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.

梦里南柯 2024-11-09 04:21:32

更改 Drupal 中的网站图标

在活动主题的设置中更改网站图标。

转到外观>您的主题设置>
并取消选中(使用主题提供的默认快捷方式图标),然后上传您的网站图标并保存。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文