Skip to content

Instantly share code, notes, and snippets.

@johnmartin johnmartin/base.html
Created Oct 18, 2012

Embed
What would you like to do?
CKAN 2.0 config to JS module
{% ckan_extends %}
{% block styles %}
{{ super() }}
<div class="js-hide" data-module="google-analytics" data-module-sitetitle="{{ config['ckan.site_title'] }}"></div>
{% endblock %}
this.ckan.module('google-analytics', function(jQuery, _) {
return {
options: {
sitetitle: ''
},
initialize: function() {
console.log(this.options.sitetitle);
jQuery('a').on('click', function() {
console.log('a clicked!');
});
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.