Hi Alicia,

At EPFL, we created our own templates and specified it in the config. If you did the same, then the best place IMHO would be in webstyle_templates_YOUR_INSTALL.py. We redefined the function tmpl_pagefooter in order to incorporate analytics.

The original webstyle_templates is located in cds-invenio/modules/ webstyle/lib/webstyle_templates.py

You'll find the code of this function below

Hope this helps,
Best regards,
Greg


    def tmpl_pagefooter(self, req=None, ln=cdslang, lastupdated=None,
                        pagefooteradd=""):
        """Creates a page footer

           Parameters:

          - 'weburl' *string* - The base URL for the site

          - 'ln' *string* - The language to display

          - 'sitename' *string* - the first part of the page HTML title

          - 'supportemail' *string* - email of the support team

          - 'version' *string* - the version number of CDS Invenio

          - 'lastupdated' *string* - when the page was last updated

          - 'languagebox' *string* - the HTML code for the language box

          - 'pagefooteradd' *string* - additional page footer HTML code

           Output:

          - HTML code of the page headers
        """

        # load the right message language
        _ = gettext_set_language(ln)

        if lastupdated:
            if lastupdated.startswith("$Date: "):
                lastupdated = convert_datestruct_to_dategui(\
convert_datecvs_to_datestruct(lastupdated),
                                 ln=ln)
            msg_lastupdated = _("Last updated") + ": " + lastupdated
        else:
            msg_lastupdated = ""

        out = """%(pagefooteradd)s
  <!-- end of content block -->
</div>
<div id="footer">
<a href="http://www.epfl.ch/impressum.html";>&copy;2004&#8211;2007 EPFL</a>, 1015 Lausanne, t&eacute;l. ++41 +21 693 11 11,
    <a href="mailto:[email protected]";>[email protected]</a><br />
%(msg_poweredby)s <a href="http://cdsware.cern.ch/";>CDS Invenio</ a> v%(version)s, %(msg_lastupdated)s
</div>

<!-- Google analytics -->
<script src="http://www.google-analytics.com/urchin.js"; type="text/ javascript"></script>
<script type="text/javascript">
_uacct = "UA-1830336-6";
urchinTracker();
</script>


</body>
</html>
        """ % {
          'msg_poweredby' : _("Powered by"),
          'msg_maintainedby' : _("Maintained by"),
          'msg_lastupdated' : msg_lastupdated,
          'version' : version,
          'pagefooteradd' : pagefooteradd,

        }
        return out



Le 26 juin 08 à 09:20, Acero Fernandez Alicia a écrit :

Hi Tibor,

I need to add track code for google analytics in my invenio installation, and I need to know in which script I should add it. I have added it in my indico installation in the base.py module, which is the equivalent in invenio?

Thank you in advance.
Regards
Alicia
---------------------------- Confidencialidad: Este mensaje y sus ficheros adjuntos se dirige exclusivamente a su destinatario y puede contener información privilegiada o confidencial. Si no es vd. el destinatario indicado, queda notificado de que la utilización, divulgación y/o copia sin autorización está prohibida en virtud de la legislación vigente. Si ha recibido este mensaje por error, le rogamos que nos lo comunique inmediatamente respondiendo al mensaje y proceda a su destrucción. Disclaimer: This message and its attached files is intended exclusively for its recipients and may contain confidential information. If you received this e-mail in error you are hereby notified that any dissemination, copy or disclosure of this communication is strictly prohibited and may be unlawful. In this case, please notify us by a reply and delete this email and its contents immediately. ----------------------------

____________________________________________________________________

Gregory Favre
Coordinateur Infoscience
École Polytechnique Fédérale de Lausanne
KIS - DIT
Case Postale 121
CH-1015 Lausanne
+41 21 693 22 88
+ 41 79 526 52 13
[email protected]
http://plan.epfl.ch/?sciper=128933
____________________________________________________________________



Reply via email to