Add a top banner to Hue!

Add a top banner to Hue!

We have already seen in this post how you can configure Hue in your cluster. But did you know that there’s a property that can make a top banner appear in your Hue installation? Screenshot 2015-03-23 16.33.12 This is quite useful if you want for instance to show a disclaimer to your users, or to clearly mark a testing or production environment, or if you want to display some dynamic information there. Depending on if you are using Cloudera Manager or not, you should either add a safety valve or edit a .ini file to use this feature. For details on how to change the configuration, read here. In the desktop/custom section of the ini file you can find the banner_top_html property:

[desktop]
[[custom]]
# Top banner HTML code
banner_top_html=

Then it’s just a matter of writing some HTML/CSS and even Javascript code to customized it as you prefer. Keep in mind that you have a limited height to do that (30px). For instance, to write a the same message you see on demo.gethue.com, you can write this:

[desktop]
[[custom]]
# Top banner HTML code
banner_top_html='<div style="padding: 4px; text-align: center; background-color: #EEE; height: 40px"><i class="fa fa-flash muted"></i> This is Hue 3.11 read-only demo  - <a href="http://gethue.com/hue-3-11-with-its-new-s3-browser-and-sql-autocomplete-is-out/" target="_blank">Read more about it</a> or <a href="/notebook/editor?editor=11">open a sample query</a>! <i class="fa fa-flash muted"></i></div>'

Or we could even use a very old HTML tag to display a running ticker!

[desktop]
[[custom]]
# Top banner HTML code
banner_top_html='<marquee behavior="scroll" direction="left" scrollamount="2" style="font-size: 15px;padding: 5px;color:#338BB8;font-weight:bold">Welcome to the test environment.</marquee>'

Screenshot 2015-03-23 18.56.32.

Pretty cool, uh? Now it’s your turn to create something useful with it! As usual feel free to comment on the hue-user list or @gethue!

5 Comments

  1. dale 2 years ago

    Very cool! Having trouble adding a background colour to the banner. E.g. banner_top_html=’test does not work. Is it meant to be normal HTML here?

    Also, noticed a slight bug: If you enable the banner and then go to create a new workflow in Oozie then the formatting of the Actions bar gets messed up.

  2. Dale 2 years ago
    • Hue Team 2 years ago

      Oh I see! That has been fixed after 3.8.1. You can try it on master for instance!

      • Dale 2 years ago

        ok great, thanks.

Leave a reply

Your email address will not be published. Required fields are marked *

*