EllisLab text mark
Advanced Search
1 of 4
1
   
Extension: Add Site Name (to Control Panel header) The original! ;-)
Posted: 25 June 2007 09:18 PM   [ Ignore ]
Avatar
Joined: 2006-03-26
1664 posts

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/

Image Attachments
ext_sample.pngversion115.png
 Signature 

ryan masuga
—————
Masuga Design | devot:ee
@masuga | @masugadesign | @devot_ee

 
Posted: 25 June 2007 09:46 PM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Avatar
Joined: 2006-01-20
336 posts

Works like a charm for me buddy o pal.

 Signature 

AJ Penninga
Pretty Squares, LLC - http://www.prettysquares.com

 
Posted: 25 June 2007 10:33 PM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Avatar
Joined: 2002-08-04
1830 posts

This looks useful, I’m always getting confused when multiple sites are open.

 
Posted: 25 June 2007 11:29 PM   [ Ignore ]   [ # 3 ]   [ Rating: 0 ]
Avatar
Joined: 2006-01-20
336 posts

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?

 Signature 

AJ Penninga
Pretty Squares, LLC - http://www.prettysquares.com

 
Posted: 25 June 2007 11:37 PM   [ Ignore ]   [ # 4 ]   [ Rating: 0 ]
Avatar
Joined: 2006-03-26
1664 posts

Keep those ideas coming. I could use some practice with extension settings.

 Signature 

ryan masuga
—————
Masuga Design | devot:ee
@masuga | @masugadesign | @devot_ee

 
Posted: 26 June 2007 02:24 AM   [ Ignore ]   [ # 5 ]   [ Rating: 0 ]
Avatar
Joined: 2004-04-14
109 posts

Nice, Thank you

Works well in 1.6.

But see the picture what happens in 1.5.2. There is a white space.

Image Attachments
add_sitename_screen.gif
 Signature 

Werner Gusset | http://www.octave2media.ch |
Translator German language files for EE & add-ons

 
Posted: 26 June 2007 03:59 AM   [ Ignore ]   [ # 6 ]   [ Rating: 0 ]
Avatar
Joined: 2007-01-05
1427 posts

What a great idea!

I tested it in EE 1.6 using IE6 for you and it works fine.

PS. I second the ability to add a logo there. Perhaps you can add some size rules?

 Signature 

Steven Hambleton | Hambo Development

WE SPECIALISE IN WORKING WITH AGENCIES AND BUILDING LONG TERM DEVELOPMENT PARTNERSHIPS 
 
Posted: 26 June 2007 04:04 AM   [ Ignore ]   [ # 7 ]   [ Rating: 0 ]
Avatar
Joined: 2004-04-14
109 posts

Using FF on XP.

Any hint where to size?

 Signature 

Werner Gusset | http://www.octave2media.ch |
Translator German language files for EE & add-ons

 
Posted: 26 June 2007 01:12 PM   [ Ignore ]   [ # 8 ]   [ Rating: 0 ]
Avatar
Joined: 2006-03-26
1664 posts
Werner Gusset - 26 June 2007 08:04 AM

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.

 Signature 

ryan masuga
—————
Masuga Design | devot:ee
@masuga | @masugadesign | @devot_ee

 
Posted: 26 June 2007 08:00 PM   [ Ignore ]   [ # 9 ]   [ Rating: 0 ]
Avatar
Joined: 2002-05-25
154 posts

Iam running EE 1.6 Build: 20070622 but I can’t see any Site Name in Control Panel header. What’s strange? I’ve installed extension properly.

 Signature 

+ CM faviconizEE
+ CM Nice URL
+ CM Strange URL Interpreter
+ CM Textarea Resizer
+ CM Template Editor

 
Posted: 26 June 2007 08:03 PM   [ Ignore ]   [ # 10 ]   [ Rating: 0 ]
Avatar
Joined: 2002-05-25
154 posts

Somewhere this script extension but somewhere not…

 Signature 

+ CM faviconizEE
+ CM Nice URL
+ CM Strange URL Interpreter
+ CM Textarea Resizer
+ CM Template Editor

 
Posted: 26 June 2007 10:27 PM   [ Ignore ]   [ # 11 ]   [ Rating: 0 ]
Avatar
Joined: 2006-03-26
1664 posts
Gabriel - 27 June 2007 12:03 AM

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? grin

 Signature 

ryan masuga
—————
Masuga Design | devot:ee
@masuga | @masugadesign | @devot_ee

 
Posted: 28 June 2007 12:05 AM   [ Ignore ]   [ # 12 ]   [ Rating: 0 ]
Avatar
Joined: 2007-01-05
1427 posts
mdesign - 27 June 2007 02:27 AM
Gabriel - 27 June 2007 12:03 AM

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? grin

It shouldn’t be as EE won’t let you setup a site without a site name.

 Signature 

Steven Hambleton | Hambo Development

WE SPECIALISE IN WORKING WITH AGENCIES AND BUILDING LONG TERM DEVELOPMENT PARTNERSHIPS 
 
Posted: 06 July 2007 05:56 AM   [ Ignore ]   [ # 13 ]   [ Rating: 0 ]
Avatar
Joined: 2006-06-10
144 posts

Thanks Ryan, smart plug!

Do you think you could add some styling to it? My prefs would be simply to have the same font size as the EE version title..

 
Posted: 06 July 2007 09:38 AM   [ Ignore ]   [ # 14 ]   [ Rating: 0 ]
Avatar
Joined: 2006-03-26
1664 posts

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?

 Signature 

ryan masuga
—————
Masuga Design | devot:ee
@masuga | @masugadesign | @devot_ee

 
Posted: 07 July 2007 08:21 AM   [ Ignore ]   [ # 15 ]   [ Rating: 0 ]
Avatar
Joined: 2002-05-25
154 posts
mdesign - 27 June 2007 02:27 AM
Gabriel - 27 June 2007 12:03 AM

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? grin

I’m disabled Clone Entries (v.1.0) extension, and Site Name shown. Could you check both extension where is the conflict? Thank you.

 Signature 

+ CM faviconizEE
+ CM Nice URL
+ CM Strange URL Interpreter
+ CM Textarea Resizer
+ CM Template Editor

 
1 of 4
1