Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello ALL!
I've already set up two domains under the same tree and they are working fine, but I'd like to use different favicons, is it possible?
[]s
Spectra
Comments
Use the link command in your
Use the link command in your theme and the browsers will pick that up instead of the default icon.
try this example below.
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
Just change the href to what you want.
--
Gordon Heydon
Heydon Consulting
--
Gordon Heydon
mod_rewrite
I believe the only way to do this is with mod_rewrite - modify the same rewrite rules that make friendly links work and you should be set. If you need help doing this feel free to ask.
--
http://www.electroniclife.org/
Oh, gordon, duuuuhh.. man,
Oh, gordon, duuuuhh.. man, can't believe I forgot about that. Ignore my overly complicated mod_rewrite solution. Granted, gordon's solution probably means you'll be mucking in your theme...
--
http://www.electroniclife.org/
Different themes
Are you using the exact same theme from the same directory for all the domains? If so, then there is no solution, not even the link solution above.
What you can do is "clone" the theme to another directory. Say you have domain1 and domain2, then under the themes directory, created two new directories, e.g. domain1 and domain2. Then copy the theme you are using (say pushbutton or friendselectric) to each of these directories.
Now, you can put a separate "link" line for each domain, since they have a different theme in a different directory.
--
Drupal performance tuning and optimization, hosting, development, and consulting: 2bits.com, Inc. and Twitter at: @2bits
Personal blog: Ba
If you can run PHP in your theme ...
... you can pick the favicon href based on $_SERVER['HTTP_HOST']. That probably means you'll need to use a phptemplate-based theme.
Actually, the solution I
Actually, the solution I first presented would still work in the case of useing the same theme on all sites. Using mod_rewrite you could serve specific favicons for certain domains.
--
http://www.electroniclife.org/
mod_rewrite example
Aran, could you give an example of the mod_rewrite statement(s) needed?
This is not correct.
This is not correct.
If you put a link in your theme page.tpl.php with a variable in it that picks up the current site then that does the trick.
eg:
print "<link rel='shortcut icon' href='". ROOT_DIR ."/".SITE."/pix/favicon.ico' >";
the new phptemplate does this
(for CVS HEAD).
It picks up favicon.ico files in the theme directory.
--
The future is so Bryght, I have to wear shades.
A suggestion
Adrian, I am not sure if this is a general theme thing, or phptemplate specific. But I will ask anyway, since you brought it up.
Can the favico be configurable? Like the logo?
I mean that under /admin/settings/theme there would be a text field for entering the favico, just like the logo is now.
Then the template would have a line with "link" as suggested above.
This allows someone who runs multiple sites to have a subdirectory for each site, with the logo, favico, ..etc.
--
Drupal performance tuning and optimization, hosting, development, and consulting: 2bits.com, Inc. and Twitter at: @2bits
Personal blog: Ba