Results 1 to 18 of 18

Thread: [myfavicon] MyFavicon -- creates, links multi-size ICO files

  1. #1
    Experienced user
    Join Date
    06-10-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default [myfavicon] MyFavicon -- creates, links multi-size ICO files

    This is a really, really, really, really useful utility, because it doesn't just link a favicon file, it actually creates a fully-compatible ICO file, containing all the relevant sizes up to the size of the source image and then links the resulting multi-size ICO file to your page as a favicon.

    For example, if you have a 550x550px transparent PNG, the system will auto create ICO images for: 16x16, 24x24, 32x32, 64x64, 128x128, 256x256 and 512x512 and add them all to a single ICO file and write it to the root of the website: favicon.ico. No more messing with online sites to convert the PNG to ICO first, and this allows your client to modify the favicon on the fly, for specials, christmas, etc.

    This also allows you to have multiple favicons per root, as the filename generated can be linked to the root alias, e.g. favicon-root.ico to allow multiples in the root.

    http://www.contao.org/extension-list/vi ... vicon.html

    This release integrates at PAGE level, where there are favicon settings:
    • Add favicon (to activate)[/*:m:1w3z6bxh]
    • Favicon source file a PNG with transparency is preferred, but you can use PNG, JPG or GIF. A Square ratio is not necessary, as the image will simply be cropped to be square[/*:m:1w3z6bxh]
    • An option to enable the appending of the root page's alias to the favicon file[/*:m:1w3z6bxh]

    NOTE: If you want to recreate the icon you simply delete it and the system will auto-create it again.

  2. #2
    User PaoloB's Avatar
    Join Date
    06-19-09.
    Location
    Italy
    Posts
    238

    Default Re: [myfavicon] MyFavicon -- creates, links multi-size ICO f

    very good extension

    you report a very small bug.
    In the floIcon.php the php tag is short tags, <? only
    I like the full tag <?php
    Paolo B.
    Contao ambassador
    ContaoCms.it - Sito di riferimento per la comunità italiana

  3. #3
    Experienced user
    Join Date
    06-10-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: [myfavicon] MyFavicon -- creates, links multi-size ICO f

    Well I didn't write that, I'm just using it as a plug-in, I've added the php in the author's file.

  4. #4
    User
    Join Date
    08-05-09.
    Posts
    35

    Default Re: [myfavicon] MyFavicon -- creates, links multi-size ICO f

    Hi,
    sorry to bother you, I am a Contao rookie... i have installed this extension, now i cannoit find howto invoke it..where can I add the icon source file ??

    thx, frank

  5. #5
    Community-Moderator xchs's Avatar
    Join Date
    06-19-09.
    Posts
    1,287

    Default Re: [myfavicon] MyFavicon -- creates, links multi-size ICO f

    Quote Originally Posted by muitobom
    where can I add the icon source file ??
    Back end module "Site structure" -> Page edit icon ("pencil")
    Contao Community Moderator
    → Support options

  6. #6
    New user
    Join Date
    07-20-12.
    Posts
    1

    Default Re: [myfavicon] MyFavicon -- creates, links multi-size ICO f

    Hi,
    Im also a rookie one, its my first extension install.
    When i activate the favicon and choose de ico file its shows a fatal error instead of the web site :

    Fatal error: Uncaught exception Exception with message Cannot create file "favicon-espanol.ico" thrown in /var/www/system/libraries/File.php on line 109

    #0 /var/www/system/modules/myfavicon/MyFavicon.php(158): File->__construct('favicon-espanol...')
    #1 /var/www/system/modules/myfavicon/MyFavicon.php(90): MyFavicon->createIcon('tl_files/imagen...', 'espanol')
    #2 /var/www/system/modules/frontend/PageRegular.php(87): MyFavicon->customFavicon(Object(DB_Mysql_Result), Object(DB_Mysql_Result), Object(I18nL10nPageRegular))
    #3 /var/www/system/modules/i18nl10n/I18nL10nPageRegular.php(61): PageRegular->generate(Object(DB_Mysql_Result))
    #4 /var/www/index.php(198): I18nL10nPageRegular->generate(Object(DB_Mysql_Result))
    #5 /var/www/index.php(333): Index->run()
    #6 {main}


    what can I do?
    Really thanks for the extension and for your help

  7. #7
    Experienced user
    Join Date
    06-10-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: [myfavicon] MyFavicon -- creates, links multi-size ICO f

    This is a File permission problem while creating a the favicon file in the root, check your hosting. You should download and run the contao-check.php script to understand what permissions are wrong. Most hosting companies have to install the suPHP extension, which only allows the PHP script to run as an FTP user with it's permissions, otherwise it runs as www, and it has lots more permissions, but this causes files created, unremovable using FTP.

  8. #8
    Community-Moderator lucina's Avatar
    Join Date
    10-08-10.
    Location
    Issy-les-moulineaux
    Posts
    93

    Default Re: [myfavicon] MyFavicon -- creates, links multi-size ICO f

    Hi Thyon,

    for me it looks like that in a multidoiman environment when adding a domain name to icon name there will be no good old plain favicoon.ico be genereated. In my opinion that should be written also as a file, as search engines like Google Bot explicitly search for it even if there is a meta tag for favicion-{domainname}.ico

    Also an apple webapp icon could be created (just by setting the appropriate meta tag like specified on http://developer.apple.com/library/ios/ ... tions.html)

    Thanks a lot,
    great extension.

    Carolina.

  9. #9
    Experienced user
    Join Date
    06-10-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: [myfavicon] MyFavicon -- creates, links multi-size ICO f

    I've released a C3 compatible version. This new release also adds a checkbox to allow you to render the favicon as the default og:image tag in the header for Facebook Sharing (recommended). The icon won't be added if you already have a og:image tag in the header, so that it won't override it, e.g. for News images or specific CE images.

    lucina, I am already adding the favicon file as an iOS icon to the page source, but only if it is larger than the recommended size of 57px, up to 512 (the largest favicon i'm clipping at for now) otherwise they don't recommend you do it (it will look blocky). Also, in a multi-domain environment, how do you propose you render a default favicon.ico in the root? How can you render multiple favicon.ico files in the root, if there are multiple domains ? That won't be possible. The only alternative is to have a .htaccess rewrite that tells each domain to look for it's favicon as the favicon-(root).ico favicon.

  10. #10
    New user
    Join Date
    10-19-12.
    Posts
    3

    Default Re: [myfavicon] MyFavicon -- creates, links multi-size ICO f

    Hi to all,

    I'm new to this forum and I'm having an issue with the C3 version of MyFavicon.

    First it installs and runs as expected, icons are rendered for each domain and displayed correctly. But then many links raise the following error:

    Fatal error: Cannot redeclare class Contao\File in E:\Develop\...[local path]...\htdocs\contao\system\modules\core\library\Cont ao\File.php on line 596

    I deinstalled it - no more errors, installed it again, errors back.

    Any idea?

    Best regards from Germany!

  11. #11
    New user
    Join Date
    10-19-12.
    Posts
    3

    Default Re: [myfavicon] MyFavicon -- creates, links multi-size ICO f

    Hi to all,

    I'm new to this forum and I'm having an issue with the C3 version of MyFavicon.

    First it installs and runs as expected, icons are rendered for each domain and displayed correctly. But then many links raise the following error:

    Fatal error: Cannot redeclare class Contao\File in E:\Develop\...[local path]...\htdocs\contao\system\modules\core\library\Cont ao\File.php on line 596

    I deinstalled it - no more errors, installed it again, errors back.

    Any idea?

    Best regards from Germany!

  12. #12
    Experienced user
    Join Date
    06-10-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: [myfavicon] MyFavicon -- creates, links multi-size ICO f

    Since the error isn't being generated inside my code, it must be some type of inter-compatibility, as I have it installed on two sites, without any problems.

    There could be a namespace/C3 problem, but I'm not sure where it is there...

    My code doesn't redeclare File or any of my classes depend or extend the File class. Strange. Do you have other extensions installed?

    OK. I think I might have found the problem (although it's not an error on my side), there isn't a \ backslash before the new \File() statements. I've updated the ER, so you can update.

  13. #13
    New user
    Join Date
    10-19-12.
    Posts
    3

    Default Re: [myfavicon] MyFavicon -- creates, links multi-size ICO f

    Strange but true.

    No more errors, everything runs fine this time.

    Maybe it was something that only occurs on local installations - I have no contao website online yet.

    Thanks a lot!

  14. #14
    New user
    Join Date
    11-25-09.
    Posts
    2

    Default Re: [myfavicon] MyFavicon -- creates, links multi-size ICO f

    hy

    Im using it with contao3, where are the images (ico) generated?
    How can i update the favicon, if i change the image? Tried to delete it, re added it, reinstalled the extension, but the old favicon still exists.

    thx

  15. #15
    Experienced user
    Join Date
    06-10-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: [myfavicon] MyFavicon -- creates, links multi-size ICO f

    Favicon placement is a web standard convention.

    This extension generates a favicon.ico file in the root of the website. It only deviates if you want ANOTHER root with a different root point, then it adds the root name to the favicon-xxx.ico file.

    In order to update it, you will first need to remove the favicon.ico file using an ftp program (this provides some caching, as having to render the favicon.ico is quite processor intensive on every page load). Then when you save the page root again, where the favicon settings are, it will detect that the favicon.ico file doesn't exist, and regenerate it from the PNG again.

    The appearance of the favicon.ico in your browser is a whole other story. That depends on many, many variables, and caching involved. The best way to check it is to enter the site favicon URL manually, e.g. www . company . com/favicon.ico (AND hit refresh a few times) and that will ensure that the file is the current one.

    Most of my clients complain for weeks that the favicon isn't updated, although it is (verified). I believe the browsers take between 1 day to 1 week to update the bookmark favicon anyways.

  16. #16
    New user
    Join Date
    11-25-09.
    Posts
    2

    Default Re: [myfavicon] MyFavicon -- creates, links multi-size ICO f

    o thx for the answer it worked!

  17. #17
    New user
    Join Date
    06-27-13.
    Posts
    1

    Default Re: [myfavicon] MyFavicon -- creates, links multi-size ICO f

    Hi!
    Just tried to use the extension on Contao 3.1.1 –*seems to install but no .ico-File is generated after selecting the target image source. A compatibility-issue you can fix?

  18. #18
    Experienced user
    Join Date
    06-10-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: [myfavicon] MyFavicon -- creates, links multi-size ICO f

    Hi

    I don't get your errors, however there could possibly be some other output errors, which I have suppressed and placed in a try block. You can update the extension and delete the favicon.ico and try again.

    I have it working without a problem on 3.1.1

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •