ggolden 2002/09/09 09:57:59
Modified: webapp/WEB-INF/templates/vm GlobalMacros.vm
Log:
To aid in the integration of jetspeed into a portal project,
I want to use as much of Jetspeed "out of the box" as possible,
minimizing the set of files I need to patch or replace.
To support this, I've made a few changes to the vm templates that
control the portal page, content.vm and default.vm, with support in
JetspeedResources.properties and GlobalMacros.vm
First, each portal page html can have a set of scripts (javascript or whataver)
placed into the <head> section of the html. This is done by invoking a velocity
macro #headScripts(). This invocation is now standard in the jetspeed templates.
The default headScripts() macro in GlobalMacros.vm is empty. One would edit this or
append another script by the same name with the content one wants for one's site (if
there are two macros with the same name, the last one is used by Velocity).
Second, each portal page html <body> tag may have onLoad or other attributes. This
is done by invoking a velocity macro #bodyOnLoad(), now standard in the
jetspeed templates.
The default bodyOnLoad() in GlobalMacros.vm is empty, and can be edited or
overridden for a site.
Third, the default.vm had a html title tag that included some text pre-pended to the
portal page's title. I've changed this so that there's a new jr.p field,
"portalpage.title_prefix" to contain any prefix text for titles. We can change or
override this setting in the config files to control the title for our site.
Revision Changes Path
1.6 +16 -0 jakarta-jetspeed/webapp/WEB-INF/templates/vm/GlobalMacros.vm
Index: GlobalMacros.vm
===================================================================
RCS file: /home/cvs/jakarta-jetspeed/webapp/WEB-INF/templates/vm/GlobalMacros.vm,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- GlobalMacros.vm 20 Mar 2002 06:55:48 -0000 1.5
+++ GlobalMacros.vm 9 Sep 2002 16:57:59 -0000 1.6
@@ -122,3 +122,19 @@
$body
</td>
#end
+
+#* ------------------------------------------------------------------
+#
+# Macros that are used for portal page construction.
+#
+*# ------------------------------------------------------------------
+
+## place all scripts that should go into the html head in this macro.
+## append another version of this macro with your site's content (the second one
wins), or edit this one.
+## this is referenced in the templates/vm/layouts/html files.
+#macro ( headScripts ) #end
+
+## to have onload in the <body> tag of portal pages, fill out this macro with
something like this:
+## #macro (bodyOnLoad) onload="loadscript();" #end
+#macro ( bodyOnLoad ) #end
+
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>