How to add an icon?!

hi there,

how to add icon to my site? i searched for them but i found nothing. Where to put my site icon so that it shows in the browser.. I don't know where to add them.

prajwal:)

  • Do you want to add an icon (avatar) to your profile, or are you trying to add a LOGO on the front page of your website?

  • @Prajwal 

    This worked for me:

    go to YourElggFolder/views/default/page_elements. Open the file header.php

    image

    Under that code, put this:

    <link rel=”shortcut icon” type=”image/x-icon” href=”http://yourdomain.com/favicon.ico”&gt;

    (Where “yourdomain.com” is the address of your domain)

    Do not forget to put the full path/domain name pointing to where your favicon is.

    Now, save it, and refresh your website and you are done.

     

    Rodolfo Hernandez

    Arvixe/Elgg Community Liaison

  • yes Rj is right it will work

    @Prajwal you did not found anything because you serached by wrong name , try now with name of favicon then you will find thausands of refrences for how to add favicon to site.

    one more thing mine is something like this. I created a sub domain and moved all static icons ans javascipts to that subdomain which help us to avoid downloading cookies with every image and javascipt and help in speed up your site.

    it works for me.

    <link rel="shortcut icon" href="http://cdn1.royalloops.com/favicon.ico" />
  • Didn't work for me! Following is my code, in context, from public_html/views/default/page_elements/header.php:

        <!-- include the default css file -->
        <link rel="stylesheet" href="<?php echo $vars['url']; ?>_css/css.css?lastcache=<?php echo $vars['config']->lastcache; ?>&amp;viewtype=<?php echo $vars['view']; ?>" type="text/css" />

        <?php
            echo $feedref;
            echo elgg_view('metatags',$vars);
        ?>

        <!-- Link for Favicon goes here -->
        <link rel=”shortcut icon” type=”image/x-icon” href=”http://my-odb-space.net/favicon.ico”&gt;

        <script type="text/javascript">
            jQuery(document).ready(function($) {
            });
        </script>

    </head>

    The favicon was created using http://htmlkit.com/favicon/ and loaded to the root directory (public_html) of my website. I know it's there because I can go to http://www.my-odb-space.net/favicon.ico and the image is displayed.

    Yesterday, I tried putting the favicon link a little farther up, following the title tag. That worked, except only on inital program load, but it would disappear when user logged in.

    I would appreciate any help you could offer.

    Thank you,

    Roy

     

     

     

  • @FreeGeezer I see the problem. It is the quotes. Take a look:

     

    This is what you have:

    <link rel=”shortcut icon” type=”image/x-icon” href=”http://my-odb-space.net/favicon.ico”>

     

    This is what it should be:

    <link rel="shortcut icon" type="image/x-icon" href="http://my-odb-space.net/favicon.ico">

     

    Rodolfo Hernandez

    Arvixe/Elgg Community Liaison

  • Quick comment here: it's unwise to edit core files.  You should extend the metatags view instead.

  • @rjcalifornia Thank you! Who knows how long I would have gone without seeing that.

    @Evan Winslow Where would I find the metatags view you are referring to?

    Thanks, everyone, this is a great community

    Roy

     

     

  • What Evan means is that rather than changing the core files, create a new plugin and extend the views there.

  • Thanks for clarifying, Shouvik. @FreeGeezer, for more info, check out http://docs.elgg.org/wiki/Engine/Views, especially section 4.