Thursday 13 October 2011

Zenoss: hiding the page header

I didn't have time for the last couple month to write anything to this blog. So I decided to write some short article for now. And this time it will be again about Zenoss.


Quite long ago at Zenoss Community Forum I've posted a request for a portlet for Zenoss 3.0.* that shows nothing but the filtered events. As I have mentioned in my post, I've made a trick with the Site Window portlet in Zenoss 2.5.2, but in v.3.0.* this possibility disappeared. After some time, because of no response on my post, I've decided to try to do something by myself. Actually, I'm not a programmer, and am a completely newbie in python, but I was curios to make it work. And I did it!

Maybe my solution is not very good, but it is as it is.
So, I've changed a file:
/opt/zenoss/Products/ZenUI3/browser/templates/base-new.pt
diff -u:

@@ -35,6 +35,10 @@
             href="/++resource++zenui/css/zenoss.css" />
         <link rel="stylesheet" type="text/css"
             href="/++resource++zenui/css/zenui3.css" />
+        <tal:block tal:condition="python:request.get('noheader',False)">
+            <link rel="stylesheet" type="text/css"
+            href="/++resource++zenui/css/noheader.css" />
+        </tal:block>
         <tal:block tal:content="structure provider:js-security"/>
         <tal:block tal:content="structure provider:all-js"/>
         <script tal:define="container context/getPrimaryParent" tal:content="string:

And create another one:
/opt/zenoss/Products/ZenUI3/browser/resources/css/noheader.css:

/**
 * HEADER
 */
#header {
    height: 0px !important;
    visibility:hidden ; }
Now, when you add "?noheader=1" to your URL to any Zenoss page, the header will not be displayed.

Here is an example of the Site Window on my Dashboard with URL to the filtered Event View: