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

Gabriel's avatar
Gabriel
130 posts
18 years ago
Gabriel's avatar Gabriel
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? 😊

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

       
Ryan M.'s avatar
Ryan M.
1,511 posts
18 years ago
Ryan M.'s avatar Ryan M.
I’m disabled Clone Entries (v.1.0) extension, and Site Name shown. Could you check both extension where is the conflict? Thank you.

Ahh! My first extension conflict. I’ll take a look at that other extension and see what I might have done incorrectly. Thanks for pointing it out.

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

I just updated this extension to version 1.1.0 (see top of thread), which now has 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). I attached a pic showing a sample modified site name in bold, light green Trebuchet at 16px.

I looked a little bit at the extension conflict with Cloner, and all I could see was that where they’re using the same hook as I am, it doesn’t look like they used the last call code you’re supposed to use:

if($EXT->last_call !== false)
 {
  $out = $EXT->last_call;
 }

I could be totally wrong though, as I’m still new at writing extensions. If I figure out anything, I’ll let you know.

UPDATE: As far as I could tell in Cloner, around line 181 is this:

$DB->query($DB->insert_string('exp_extensions',
                array(
                'extension_id'    => '',
                'class'            => "Cloner",
                'method'        => "remove_entryid",
                'hook'            => "show_full_control_panel_end",
                'settings'        => "",
                'priority'        => 10,
                'version'        => $this->version,
                'enabled'        => "y"
                )
            )
        );

Changing the ‘priority’ line from 10 to 9 works for me:

'priority'        => 9,

I’m not entirely sure what that did though, but it does get them to play nice together.

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

mdesign: yeah, either works fine. Great job!

What’s about possibility adding the graphic logo of the site before the name or allowing show logo alone?

       
Ryan M.'s avatar
Ryan M.
1,511 posts
18 years ago
Ryan M.'s avatar Ryan M.
mdesign: yeah, either works fine. Great job! What’s about possibility adding the graphic logo of the site before the name or allowing show logo alone?

I thought about the logo, but there seem to be a lot of things to consider with that. The size of the header might change based on the logo height, the logo might look bad on that blue background. Do you upload through the extension’s CP page (and where does that upload to?), or just FTP the logo up to a server and point to it from the CP page? Should there be max widths and heights imposed? Some logos will look horrible with tiny limits in place, while others might be fine. Is there an easier way to do this than through this extension?

I’m sure I could think of a number of other possible issues. Besides, the name of this extension is “Add Site Name”, not “Add Site ID”, although if a logo option were added, I might need to change the name to something more clever and EE-like, like “Site IDee (idEE?)”

It would be nice too if I could get this to work with the CP login page! But I don’t know if there is a hook for that or not.

       
OrganizedFellow's avatar
OrganizedFellow
435 posts
18 years ago
OrganizedFellow's avatar OrganizedFellow
I thought about the logo, but there seem to be a lot of things to consider with that. The size of the header might change based on the logo height, the logo might look bad on that blue background …

How bout a limited ability?

16x16? 32x32?

I doubt anyone would want to have an oversized 100px+ logo in their header. Besides, the intent of this extension (properly used) is to identify/personalize your control panel, right? As for the colored background, perhaps an option where the user can enter a hexidecimal value that would become the background for the (xLOGOx + SiteName + ExpressionEngine v.xyz).

😊

GREAT extension BTW!

       
GMJ's avatar
GMJ
5 posts
18 years ago
GMJ's avatar GMJ

Nice one. Works like a charm in v1.6. Will make this a must have in any new install.

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

I just updated this extension to 1.1.1 with a new setting: Text Override. Basically, I have a lot of other work to do, and I’m just procrastinating today.

You can now make the text say whatever you want. Might be handy to designate “development” sites, shorten a real long name, play a prank, or whatever. The field is totally optional and will just default to your site name.

See attached sample pic here, showing a “dev” note - and grab the latest version in the first post of this thread.

       
OrganizedFellow's avatar
OrganizedFellow
435 posts
18 years ago
OrganizedFellow's avatar OrganizedFellow

Excellent! Thank you so much for this.

Perhaps next time, you could allow a small graphical icon? 😊 Nothing bigger than 16x16 or 32x32.

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

Or better yet, have it just try to find the favicon on your site.

www.domain.com/favicon.ico

       
Ryan M.'s avatar
Ryan M.
1,511 posts
18 years ago
Ryan M.'s avatar Ryan M.
Or better yet, have it just try to find the favicon on your site.

I think that’s way to go. I just need to think of the logic: New setting: “Show favicon?” If that is set to “yes” (it being set to “no” by default), then look for the favicon, and center it to the left of your site name.

What do you think, jammo?

       
OrganizedFellow's avatar
OrganizedFellow
435 posts
18 years ago
OrganizedFellow's avatar OrganizedFellow
… have it just try to find the favicon on your site.
… What do you think, jammo?

abso-freaking-lutely. I’d love it eeven more!

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

Cool. AJP just pointed me to a resource that should help me make this work. I’m out of town this weekend, but I’ll update this when I get a spare moment.

       
OrganizedFellow's avatar
OrganizedFellow
435 posts
18 years ago
OrganizedFellow's avatar OrganizedFellow

Take your time. Enjoy your business/pleasure trip.

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

OK, I uploaded v1.1.2 (see first post in the thread) along with a pic of the favicon in action! Let me know if it works as you’d expect. I looked at this in FF/Safari on Mac and things looked as they should. Bug reports welcome.

       
1 2 3 4

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.