We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Extension: Add Site Name (to Control Panel header) The original! ;-)

Development and Programming

Ryan M.'s avatar
Ryan M.
1,511 posts
18 years ago
Ryan M.'s avatar Ryan M.

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/

       
AJP's avatar
AJP
311 posts
18 years ago
AJP's avatar AJP

Works like a charm for me buddy o pal.

       
PXLated's avatar
PXLated
1,800 posts
18 years ago
PXLated's avatar PXLated

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

       
AJP's avatar
AJP
311 posts
18 years ago
AJP's avatar AJP

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?

       
Ryan M.'s avatar
Ryan M.
1,511 posts
18 years ago
Ryan M.'s avatar Ryan M.

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

       
Werner Gusset's avatar
Werner Gusset
122 posts
18 years ago
Werner Gusset's avatar Werner Gusset

Nice, Thank you

Works well in 1.6.

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

       
stinhambo's avatar
stinhambo
1,268 posts
18 years ago
stinhambo's avatar stinhambo

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?

       
Werner Gusset's avatar
Werner Gusset
122 posts
18 years ago
Werner Gusset's avatar Werner Gusset

Using FF on XP.

Any hint where to size?

       
Ryan M.'s avatar
Ryan M.
1,511 posts
18 years ago
Ryan M.'s avatar Ryan M.
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.

       
Gabriel's avatar
Gabriel
130 posts
18 years ago
Gabriel's avatar Gabriel

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.

       
Gabriel's avatar
Gabriel
130 posts
18 years ago
Gabriel's avatar Gabriel

Somewhere this script extension but somewhere not…

       
Ryan M.'s avatar
Ryan M.
1,511 posts
18 years ago
Ryan M.'s avatar Ryan M.
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? 😊

       
stinhambo's avatar
stinhambo
1,268 posts
18 years ago
stinhambo's avatar stinhambo
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.

       
Nutmeg's avatar
Nutmeg
111 posts
18 years ago
Nutmeg's avatar Nutmeg

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..

       
Ryan M.'s avatar
Ryan M.
1,511 posts
18 years ago
Ryan M.'s avatar Ryan M.

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?

       
1 2 3 Last

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.