cmall / LocalHomePage

A Local Home Page for OSX Web Development
http://mallinson.ca/post/osx-web-development
305 stars 123 forks source link

Where does the $icon for the site go? #3

Open jaycbrf4 opened 9 years ago

jaycbrf4 commented 9 years ago

// Display an icon for the site $icon_output = ''; foreach( $icons as $icon ) {

                    if ( file_exists( $file . '/' . $icon ) ) {
                        $icon_output = sprintf( '<img src="%1$s/%2$s">', $siteroot, $icon );
                        break;
                    } // if ( file_exists( $file . '/' . $icon ) )

                } // foreach( $icons as $icon )
                echo $icon_output;

Where is this image placed?

nrtyc4 commented 9 years ago

The images should go in the LocalHomePage/img folder. That's where the only images are now in the project. From the config file, the icons from the img folder are created in an array of strings called $icons. Then in the index.php file, foreach( $icons as $icon ), then if it exists append it to the site root and display it on the site! I hope this helps

jaycbrf4 commented 9 years ago

Thanks for the reply but I figured it out-

The images should go in the LocalHomePage/img folder. That's where the only images are now in the project. From the config file, the icons from the img folder are created in an array of strings called $icons. Then in the index.php file, foreach( $icons as $icon ), then if it exists append it to the site root and display it on the site! I hope this helps

— Reply to this email directly or view it on GitHub https://github.com/cmall/LocalHomePage/issues/3#issuecomment-66938119.

alisamii commented 8 years ago

Hi...what do the icons need to be named so that they can be displayed?

I tried sitename-icon and sitename but neither seems to work.

It would be nice if, instead of the grey square to the left of the site name, the favicon of the site would be displayed. I am guessing that is the purpose of the icons...but I can't seem to get it to work.

Also, you have a Wordpress test that displays a wordpress logo to the right of the site name. Is there a way to extend that so it can detect different platforms (wordpress, joomla, drupal, laravel, etc.) and display the appropriate icon. And if it cannot determine the platform, at least display a generic technology icon (eg, php, html, etc)?

Thanks