Blog

Posted 2007/11/22

Using Javascript with a Gridsphere 3.0.X theme

I have a small piece of Javascript for collapsing the header of the VERA theme I made for Gridsphere (GS). While there are ways to add custom Javascript includes via portlets I can't see a way to add an extra file for the whole portal (my GS theme needs some Javascript).

The Java that writes out the HTML header for each page can be found at:


org/gridsphere/layout/view/brush/Page.java

Looking though this file you can find a bunch of code for altering the header that GS writes out using preferences set by portlets but there is nothing for portal-wide includes. So I can either alter the Java to hardcode my new include or edit one of the Javascript includes GS already uses.

This is gripe I have with theming/integrating GS - doing any kind of tight integration requires CSS, button clicking in GS, XML editing and now possibly hacking at the code. Not a very clean solution and from my experiences not very well documented.