更改 Drupal 中的图标
我已将新的图标上传到 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>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
如您所见,HTML 指向默认的图标:
Drupal 不会覆盖它,但会将您的自定义图标上传到“files/....”,然后更改 HTML 以使用它。
您的 HTML 未更改。这可能意味着以下两件事之一:
我怀疑是后者。您主题的
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:
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:
就我而言,它使用的是 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.
更改 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.