Skip to content. | Skip to navigation

Personal tools

Navigation

You are here: Home / Classes / JavaScript, jQuery & jQuery Tools in Plone / Steps to add jQuery "hello" to Plone Theme

Steps to add jQuery "hello" to Plone Theme

by Steve McMahon last modified May 26, 2010 11:49 AM

Plain Text icon stepone.txt — Plain Text, 1 KB (1773 bytes)

File contents

Index: plonetheme/blingout/browser/configure.zcml
===================================================================
--- plonetheme/blingout/browser/configure.zcml	(.../from_zopeskel)	(revision 118189)
+++ plonetheme/blingout/browser/configure.zcml	(.../1.2)	(revision 118189)
@@ -50,4 +50,10 @@
       layer=".interfaces.IThemeSpecific"
       />
 
+  <browser:resourceDirectory
+      name="plonetheme.blingout.javascripts"
+      directory="javascripts"
+      layer=".interfaces.IThemeSpecific"
+      />
+
 </configure>
Index: plonetheme/blingout/browser/javascripts/main.js
===================================================================
--- plonetheme/blingout/browser/javascripts/main.js	(.../from_zopeskel)	(revision 0)
+++ plonetheme/blingout/browser/javascripts/main.js	(.../1.2)	(revision 118189)
@@ -0,0 +1,7 @@
+jQuery(
+    
+    function () {
+        jQuery('body').prepend('<h1>Hello, World</h1>');
+    }
+    
+);
\ No newline at end of file
Index: plonetheme/blingout/profiles/default/jsregistry.xml
===================================================================
--- plonetheme/blingout/profiles/default/jsregistry.xml	(.../from_zopeskel)	(revision 118189)
+++ plonetheme/blingout/profiles/default/jsregistry.xml	(.../1.2)	(revision 118189)
@@ -17,11 +17,11 @@
       See registerScript() arguments in ResourceRegistries/tools/JSRegistry.py
       for the latest list of all available keys and default values.
       -->
-<!-- EXAMPLE (UNCOMMENT TO MAKE AVAILABLE):
+
  <javascript
-    id="++resource++plonetheme.blingout.javascripts/something.js"
+    id="++resource++plonetheme.blingout.javascripts/main.js"
     cacheable="False" compression="safe" cookable="False"
     enabled="True" expression=""  inline="False"/>
--->
 
+
 </object>