Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4743: Add datalayer for org/pub #204

Merged
merged 3 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ckanext/datagovtheme/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
{{ super() }}
{% block googleanalytics_custom_gtag %}
{% include '/snippets/gtm/gtm_head.html' %}
{% include '/snippets/gtm/gtm_datalayer.html' %}
robert-bryson marked this conversation as resolved.
Show resolved Hide resolved
{% endblock %}
{% block open_graph_previews %}
{% include '/snippets/link_preview.html' %}
Expand Down
24 changes: 24 additions & 0 deletions ckanext/datagovtheme/templates/snippets/gtm/gtm_datalayer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

{% set pkg = c.pkg_dict %}
{% if pkg %}

{% block gtmdatalayer %}
{% set dataset = pkg.title or pkg.name or "Data.gov Dataset" %}
{% set organization = pkg.organization.title or pkg.organization.name or "error-org" %}
{% set publisher = pkg.extras.publisher or pkg.organization.name or "error-publsiher" %}
{% set language = pkg.extras.language or "en" %}

<script type="application/ld+json" class="jsonld-dataset">
dataLayer = [{
'nodeID':, {% pkg.id %},
'contentType": 'dataset',
'language': {% language %},
'homepageTest': "not_homepage",
"basicPagesubType": "dataset",
"Page_Type": "Dataset Page",
"organization": {% organization %},
"publisher": {% publisher %},
}];
</script>
{% endblock %}
{% endif %}
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

setup(
name="ckanext-datagovtheme",
version="0.2.28",
version="0.2.29",
description="CKAN Extension to manage data.gov theme",
long_description=long_description,
classifiers=[
Expand Down
Loading