You are viewing a plain text version of this content. The canonical link for it is here.
Posted to svn@forrest.apache.org by rg...@apache.org on 2007/08/13 22:44:50 UTC

svn commit: r565509 - /forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/html/google-analytics.ft

Author: rgardler
Date: Mon Aug 13 13:44:49 2007
New Revision: 565509

URL: http://svn.apache.org/viewvc?view=rev&rev=565509
Log:
Google analytics  contract

Added:
    forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/html/google-analytics.ft   (with props)

Added: forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/html/google-analytics.ft
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/html/google-analytics.ft?view=auto&rev=565509
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/html/google-analytics.ft (added)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/html/google-analytics.ft Mon Aug 13 13:44:49 2007
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+    
+    http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<forrest:contract xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+    xmlns:forrest="http://apache.org/forrest/templates/1.0"
+    name="google-analytics">
+    <description>
+        <p>
+            Embeds the necessary Javascript to allow Google Analytics to
+            track website visitors.
+        </p>
+    </description>
+    <usage>
+        Place the following code at the end of your page body, i.e. just 
+        before the &lt;/body&gt; tag.  
+        <![CDATA[
+<forrest:contract name="google-analytics">
+  <forrest:property name="google-analytics-uacct">GOOGLE_ANALYTICS_KEY</forrest:propery>
+</forrest:contract> ]]>
+    </usage>
+    <forrest:template
+        xmlns:forrest="http://apache.org/forrest/templates/1.0"
+        name="google-analytics" inputFormat="xsl">
+        <xsl:stylesheet version="1.1"
+            xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+            xmlns:forrest="http://apache.org/forrest/templates/1.0">
+            <xsl:param name="google-analytics-uacct"/>
+            <xsl:template match="/">
+                <forrest:content>
+                    <forrest:part xpath="/html/body">
+                        <script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
+                        </script>
+                        <script type="text/javascript">
+                          _uacct = "<xsl:value-of select='$google-analytics-uacct'/>";
+                          urchinTracker();
+                        </script>
+                   </forrest:part>
+                </forrest:content>
+            </xsl:template>
+        </xsl:stylesheet>
+    </forrest:template>
+</forrest:contract>

Propchange: forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/html/google-analytics.ft
------------------------------------------------------------------------------
    svn:eol-style = native