Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
WCMS
uw_fdsu_theme_resp
Commits
9bc28195
Commit
9bc28195
authored
Apr 07, 2021
by
Igor Biki
Committed by
Eric Bremner
Apr 14, 2021
Browse files
ISTWCMS-4708 Using service to include/exclude GTM scripts on template level.
parent
f7808664
Changes
2
Hide whitespace changes
Inline
Side-by-side
templates/page/html.html.twig
View file @
9bc28195
...
...
@@ -32,6 +32,7 @@
<!DOCTYPE html>
<html
{{
html_attributes
}}
class=
"no-js"
>
<head>
{%
if
not
uw_admin_page
%}
<!-- Google Tag Manager -->
<script>
(
function
(
w
,
d
,
s
,
l
,
i
){
w
[
l
]
=
w
[
l
]
||
[];
w
[
l
].
push
({
'
gtm.start
'
:
new
Date
().
getTime
(),
event
:
'
gtm.js
'
});
var
f
=
d
.
getElementsByTagName
(
s
)[
0
],
...
...
@@ -39,17 +40,20 @@
'
https://www.googletagmanager.com/gtm.js?id=
'
+
i
+
dl
;
f
.
parentNode
.
insertBefore
(
j
,
f
);
})(
window
,
document
,
'
script
'
,
'
dataLayer
'
,
'
GTM-M9XLVF
'
);
</script>
<!-- End Google Tag Manager -->
{%
endif
%}
<head-placeholder
token=
"
{{
placeholder_token
|
raw
}}
"
>
<title>
{{
head_title
|
safe_join
(
' | '
)
}}
</title>
<css-placeholder
token=
"
{{
placeholder_token
|
raw
}}
"
>
<js-placeholder
token=
"
{{
placeholder_token
|
raw
}}
"
>
</head>
<body
{{
attributes.addClass
(
body_classes
)
}}
>
{%
if
not
uw_admin_page
%}
<!-- Google Tag Manager (noscript) -->
<noscript>
<iframe
src=
"https://www.googletagmanager.com/ns.html?id=GTM-M9XLVF"
height=
"0"
width=
"0"
style=
"display:none;visibility:hidden"
></iframe>
</noscript>
<!-- End Google Tag Manager (noscript) -->
{%
endif
%}
{%
include
'@components/skiplinks/skiplinks.twig'
%}
{{
page_top
}}
{{
page
}}
...
...
uw_fdsu_theme_resp.theme
View file @
9bc28195
...
...
@@ -32,6 +32,7 @@ function uw_fdsu_theme_resp_preprocess_html(&$variables) {
// Adding the faculty colour class to the body.
$variables
[
'attributes'
][
'class'
][]
=
theme_get_setting
(
'wcms_colour_scheme'
,
'uw_fdsu_theme_resp'
)
?
theme_get_setting
(
'wcms_colour_scheme'
,
'uw_fdsu_theme_resp'
)
:
'org-default'
;
$variables
[
'uw_admin_page'
]
=
\
Drupal
::
service
(
'uw_cfg_common.uw_analytics'
)
->
administrationPage
();
}
/**
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment