I finally got the urge to read the Extension development docs and sift through a billion forum posts to find out how to do an extension. Go easy on me, please - this is my first extension! Reason For Being: I found that I am often in more than one website control panel at a time, in different tabs, and that I get a bit confused sometimes because the name of the site isn’t jumping out at me. Occasionally I’m on the wrong tab, etc. Anyway, I wrote this extension to put the name of the site at the upper left of the Control Panel header.
Again, this is my first extension, so any advice from seasoned pros would be more than welcome.
Version 1.1.5 (Mar 21 2008): Updated to account for sites using .png instead of .ico for the favicon. Good to know this will no longer be needed in 2.0 - but not everyone is going to update immediately, so there is still a need!
Version 1.1.4 (Nov 18 2007): Changed $siteurl variable. Favicon path seemed to be not working in certain cases. Let me know if it’s not working for you. 111 downloads
Version 1.1.3 (Sep 15 2007): Added the ability to make the text italic. (Thanks Hambo) 59 downloads
Version 1.1.2 (Jul 15 2007): Added the ability to show a site’s favicon next to the text. 111 downloads
Version 1.1.1 (Jul 13 2007): Added setting for overriding the default site name. You can make the text say whatever you want. Might be handy to designate “development” sites, shorten a real long name, play a prank, or whatever you like.
Version 1.1.0 (Jul 08 2007): Added settings for font-size, making the site name a link to your site’s homepage, color, font-weight, font-family, and padding on the top and the bottom (in case changing the size of the text messes the layout up at all).
Version 1.0.2 (Jul 06 2007): Added ‘stripslashes’ for site names with apostrophes.
Version 1.0.1 (Jun 25 2007):
I’ve only tested this on Firefox and Safari for Mac. I was too lazy to fire up Parallels and test in IE. Any bugs or problems with the styles in other browsers? Just let me know, and I’ll update.
I haven’t tested this on a Multi-Site managed installation, but I imagine it would work fine.
Not sure what would happen if you had a ton of extra links at the right, but I’ll cross that bridge when I get to it.
See the attached pic to see what it actually looks like in Firefox.
The download for this is now located at its designated page over at masugadesign.com: http://www.masugadesign.com/the-lab/scripts/add-sitename/
A few notes after having in my CP for the evening. It’s nice, and readable, but doesn’t really stand out.
If/when you add settings to it, allow an option to make it clickable to your {site_url} An image to “brand” the CP easily. Font-size, bold, and other style changes to it? Maybe some other simple CSS rules to easy brand the header without creating a theme?
Using FF on XP. Any hint where to size?
You want to size the text? I’m thinking of adding a few settings (never tried those yet…). I should note that I’ve never tested this with any CP theme other than 31three or the new default in EE 1.6 - hence the line you were seeing.
Does anyone know of a hook for the login page? It would be nice to have this show up at the top of the login page as well as once inside the CP.
Somewhere this script extension but somewhere not…
Don’t quite understand that part, sorry! What should the site name be? All this Ext does is take what is found in this field: CP Home > Admin > System Preferences > General Configuration > Name of Your Site
and put it in the header. Is yours blank for some reason? 😊
Somewhere this script extension but somewhere not…Don’t quite understand that part, sorry! What should the site name be? All this Ext does is take what is found in this field: CP Home > Admin > System Preferences > General Configuration > Name of Your Site and put it in the header. Is yours blank for some reason? 😊
It shouldn’t be as EE won’t let you setup a site without a site name.
I do have a version 1.0.2 that strips slashes on site names with apostrophes (just updated that in the first post - not a critical update). I am planning on trying my hand at extension settings with this one, but I’m a little jammed with projects at the moment. I could probably add a preference for everything you might want to style, with the defaults set like it is now. Some things you could probably tweak:
font-family (dropdown) font-size (number) font-weight (bold, normal) color (hex value) link (yes/no - would link the text to your site’s homepage) logo (this would be tricky and would probably have a lot of constraints, but I think it would be cool!)
While I’m at it, if anyone knows how I could get these changes into the top of the Control Panel login page (is there a hook or something?) that would be helpful. I’d like the top of the login page to be similar to the top of the Control Panel if this extension is installed. Is that not possible? Or should I do a SAEF or something?
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.