[ckan-changes] commit/ckan: rgrp: [doc][s]: correct example for including an additional css file and add template_footer_end to configuration docs.

Bitbucket commits-noreply at bitbucket.org
Tue Sep 20 18:32:20 UTC 2011


1 new changeset in ckan:

http://bitbucket.org/okfn/ckan/changeset/922d442664bd/
changeset:   922d442664bd
user:        rgrp
date:        2011-09-20 20:32:12
summary:     [doc][s]: correct example for including an additional css file and add template_footer_end to configuration docs.
affected #:  2 files (-1 bytes)

--- a/doc/configuration.rst	Tue Sep 20 18:27:43 2011 +0100
+++ b/doc/configuration.rst	Tue Sep 20 19:32:12 2011 +0100
@@ -524,3 +524,24 @@
   ckan.backup_dir = /var/backups/ckan/
 
 This is a directory where SQL database backups are to be written, assuming a script has been installed to do this.
+
+template_footer_end
+^^^^^^^^^^^^^^^^^^^
+
+HTML content to be inserted just before </body> tag (e.g. google analytics code).
+
+.. note:: can use html e.g. <strong>blah</strong> and can have multiline strings (just indent following lines)
+
+Example (showing insertion of google analytics code)::
+
+  ckan.template_footer_end = <!-- Google Analytics -->
+    <script src='http://www.google-analytics.com/ga.js' type='text/javascript'></script>
+    <script type="text/javascript">
+    try {
+    var pageTracker = _gat._getTracker("XXXXXXXXX");
+    pageTracker._setDomainName(".ckan.net");
+    pageTracker._trackPageview();
+    } catch(err) {}
+    </script>
+    <!-- /Google Analytics -->
+


--- a/doc/theming.rst	Tue Sep 20 18:27:43 2011 +0100
+++ b/doc/theming.rst	Tue Sep 20 19:32:12 2011 +0100
@@ -69,16 +69,20 @@
 
 Next, copy the ``layout.html`` template and add a reference to the new CSS file. Here is an example of the edited ``layout.html`` template::
 
- <html xmlns="http://www.w3.org/1999/xhtml"
-   xmlns:i18n="http://genshi.edgewall.org/i18n"
-   xmlns:py="http://genshi.edgewall.org/"
-   xmlns:xi="http://www.w3.org/2001/XInclude"
-   py:strip="">
-   <py:def function="optional_head">
-       <link rel="stylesheet" href="${g.site_url}/css/mycss.css" />
-   </py:def>
-   <xi:include href="layout_base.html" />
- </html>
+  <html xmlns="http://www.w3.org/1999/xhtml"                     
+    xmlns:i18n="http://genshi.edgewall.org/i18n"                 
+    xmlns:py="http://genshi.edgewall.org/"                       
+    xmlns:xi="http://www.w3.org/2001/XInclude"
+    py:strip="">                                                 
+                                                                 
+    <head py:match="head">
+      ${select('*')}
+
+      <link rel="stylesheet" href="${g.site_url}/css/mycss.css" />
+    </head>
+
+    <xi:include href="layout_base.html" />
+  </html>
 
 Retheming the Site with Templates
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -98,4 +102,4 @@
 
 .. note::
 
-  For more information on the syntax of the CKAN templates, refer to the `Genshi documentation <http://genshi.edgewall.org/wiki/Documentation>`_.
\ No newline at end of file
+  For more information on the syntax of the CKAN templates, refer to the `Genshi documentation <http://genshi.edgewall.org/wiki/Documentation>`_.

Repository URL: https://bitbucket.org/okfn/ckan/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.




More information about the ckan-changes mailing list