goFrendiAsgard / No-CMS

No-CMS, A CodeIgniter Based CMS Framework
299 stars 199 forks source link

favicon instead of logo in top left menu strip #50

Closed LiNuXaDDiKt closed 10 years ago

LiNuXaDDiKt commented 11 years ago

Hi,

Just discovered No-CMS a few days ago and my appologize if not posting my question in the right place.

I'm definitely not a pro developper but this initiative seems quite promising given it's relatively intuitive interface. I was staying away from CMS in general but this project pretty much convinced me to switch !

Just wondering how it would be possible to change the image being used in the top left black menu strip (Left of "Complete Menu").

After replacing the logo image, I noticed it was also used by this top menu and is currently resized. While it works well with the native No-CMS logo (because of how it is designed), it does not fit as well when you try to use an image which is not square like a rectangle.

Would it be a good idea to implement a separate configuration option specifically for this purpose,

Or, use favicon instead (maybe too small)?

Separate config option sounds best from my opinion.

goFrendiAsgard commented 11 years ago

Hi @LiNuXaDDiKt, there is no need to aplogize, since this is exactly the right place to acknowledge me about some issues. I'll do something about it (maybe add separate config option as you suggest). But for now (if you are familiar with HTML and CSS), you can make a copy of your current theme (it is located on themes folder) and make some modification as needed.

Thanks

LiNuXaDDiKt commented 11 years ago

Thanks @goFrendiAsgard for this incredibly quick answer !

I was not considering this being an issue but more a suggestion related to the design of the CMS.

That said, I figured what needed to be changed based on your suggestion in: themes/my_theme/views/layouts/default.php and yes I have what I consider basic HTML, CSS, and PHP knowledge.

Still, I wonder if this place should be used for general beginner questions arround No-CMS internals (not considered an issue or bug).

Any other place I should post my beginner's questions or suggestions if any?

Most likely it would often end up asking what is where in the code so I don't want to fill this forum unless you say it's ok to do so.

goFrendiAsgard commented 11 years ago

I don't have such a place yet. So creating "github issue" is absolutely alright :)

LiNuXaDDiKt commented 11 years ago

Hi,

Just tried something to try to understand the linkage between different elements but it doesn't seems to work as I expect it.

I've defined the following new Configuration Key through CMS Management:

Key : site_small_logo Value : {{ base_url }}assets/nocms/images/custom_logo/logoSmall.png

in themes/my_theme/views/layouts/default.php I changed $cms['site_logo'] to $cms['site_small_logo']

Unfortunately, I'm getting an Undefined index: site_small_logo error.

Is this usage supported or maybe I'm missing something?

goFrendiAsgard commented 11 years ago

To use config value, you will need to mess up with a bit PHP. Go to application/core/CMS_Controller.php Find "view" function. You will find these lines:

        $cms['site_name'] = $this->cms_get_config('site_name');
        $cms['site_slogan'] = $this->cms_get_config('site_slogan');
        $cms['site_footer'] = $this->cms_get_config('site_footer');
        $cms['site_theme'] = $theme;
        $cms['site_logo'] = $this->cms_get_config('site_logo');
        $cms['site_favicon'] = $this->cms_get_config('site_favicon'); 
        $cms['user_id'] = $this->cms_user_id();
        $cms['user_name'] = $this->cms_user_name();
        $cms['quicklinks'] = $this->cms_quicklinks();
        $cms['module_path'] = $this->cms_module_path();
        $cms['module_name'] = $this->cms_module_name($cms['module_path']);

add a new line

       $cms['site_small_logo'] = $this->cms_get_config('site_small_logo');

so it will become like this:

        $cms['site_name'] = $this->cms_get_config('site_name');
        $cms['site_slogan'] = $this->cms_get_config('site_slogan');
        $cms['site_footer'] = $this->cms_get_config('site_footer');
        $cms['site_theme'] = $theme;
        $cms['site_logo'] = $this->cms_get_config('site_logo');
        $cms['site_favicon'] = $this->cms_get_config('site_favicon'); 
        $cms['user_id'] = $this->cms_user_id();
        $cms['user_name'] = $this->cms_user_name();
        $cms['quicklinks'] = $this->cms_quicklinks();
        $cms['module_path'] = $this->cms_module_path();
        $cms['module_name'] = $this->cms_module_name($cms['module_path']);
        $cms['site_small_logo'] = $this->cms_get_config('site_small_logo');
LiNuXaDDiKt commented 11 years ago

With such level of precision on what to modify, it was a breeze to customize.

Works flawlessly.

Again, Thanks !

goFrendiAsgard commented 10 years ago

Done