BU Brandy
Summary
Add a logo to sidebar/footer in your EE install. And additional HTML too.
Introduction
Brandy is an MSM compatible extension that allows you to add your logo or, better yet, your client’s logo to your EE installation in either/or/both the sidebar and footer of the control panel. You could even use different logos in each place.
It also allows you to add your own (limited) additional HTML to the sidebar and/or footer.
And allows you to add your own CSS to style these areas too.
So you could also colour code your MSM sites if you wanted.
Thanks
To Ben at Versa Studio for commissioning and sponsoring this addon.
Requirements
EE 2.1.2 +
PHP 5.2.0 +
Brandy expects a folder /bu_brandy/logos/ in /themes/third_party/
Brandy will identify images added there if they are in one of the following formats: .png, .jpg, or .gif.
Download
bu-brandy-v0.9.6.zip (13KB)
Installation
Copy the /bu_brandy/ folder and its contents into /system/expressionengine/third_party/
Thus afterwards it should be /system/expressionengine/third_party/bu_brandy/
Make sure to add your logo folder and any logos to /themes/third_party/
Thus afterwards it should be /themes/third_party/bu_brandy/logos/
Usage
Go to the Settings page for the Brandy Extension and adjust the fields the way you want and hit the Submit button. Then Brandy will go to work.
Brandy looks in its theme folder for all images therein and provides you with two dropdowns to allow you to select which one of them you’d like to use in your Control Panel’s sidebar or footer.
By default it will select images called sidebar_logo.png and footer_logo.png for each area respectively, so if you’ve already added those images to the /brandy/logos/ folder in the theme folder then it will select them automatically.
You can also add your own custom HTML to the sidebar/footer areas too. By default you are limited to what EE’s XSS filter will allow you to add: so no script, object, iframe etc.
Currently, if you are adding both logo and custom HTML to an area the HTML will follow the logo.
Your logo/HTML are added, where applicable, into wrapping HTML areas named div#brandy_sidebar and div#brandy_footer for styling, and the logo image is available within these areas with a class of logo applied like so: img.logo.
There is also another field allowing you to add custom CSS. By default, and as a demonstration to get you started, Brandy adds some CSS to enable you to position the logo for the sidebar so that it’s centred in the column there. Of course you can also add more CSS there yourself, or change what’s been already added as you see fit.
CSS to provide basic colour coding of your MSM sites (should you have them) has also been added. Just edit the colour reference that’s already there in the settings per site and you should be good to go.
Notes
Sidebar logo width
When your browser is opened not very wide the sidebar in EE’s control panel minimises to 23% of the 930px page, thus approximately 213px. If you are concerned about keeping things looking good at that minimum then you might like to keep your sidebar logo at that width or less.
XSS Filtering
As mentioned, by default you are limited in what EE’s XSS filter will allow you to add to fields for HTML and CSS: so no script, object, iframe etc. This is to ensure tightened security. If you do add elements that get filtered EE will encode them, which will mean they will be disabled and won’t work as you expect.
However, if you do require elements that get filtered, and are absolutely, totally sure of what you are doing, and also willing to take responsibility for any consequences from opening things up, then you can add the following custom config variable to EE’s config file to override this:
$config['bu_brandy_xss_filtering'] = 'n';
We don’t recommend doing so, but it is your choice. That done, when you next save the extension EE’s XSS filters won’t be run on your submitted fields.
Bear in mind that if you change this config variable, you will need to resave the extension in order for its output to match your changed intention.
If you don’t add this config variable then the extension will automatically respect EE’s default XSS filters.
What Brandy doesn’t do yet
Brandy doesn’t currently change anything on your control panel login page as EE is not yet set up to make that an easily maintainable task. As soon as that changes though, and we find the time, we’ll endeavour to adjust things accordingly so that Brandy can do this too. In the meantime there are a handful of different approaches to customising things there that you can use, depending on how dirty you want to get your hands.
Support
Please contact us for support.
Change Log
- Version 0.9.6
- Updated update_extension method.
- Version 0.9.5
- Added CSS to demonstrate basic colour coding of MSM sites. Cleared out some empty system files.
- Version 0.9.4
- Fix occasional array_combine bug in PHP < 5.4.0.
- Version 0.9.3
- Minor filename adjustments.
- Version 0.9.2
- Fixed up MSM side so site-specific settings worked independently.
- Version 0.9.1
- Added ability to turn off XSS filtering via custom config variable.
- Version 0.9.0
- Extension first built.
Last edited
11 December 2016
License
Copyright BridgingUnit 2012.
BU Brandy is licensed under a Creative Commons Attribution-Share Alike 2.0 UK: England & Wales Licence.
Disclaimer
By downloading this software you assume all responsibility for its use and absolve BridgingUnit of any liability and/or responsibility.