Skip to content

Commit

Permalink
Issue #13: Flatten arrays into strings in preprocess_page().
Browse files Browse the repository at this point in the history
  • Loading branch information
Jen Lampton committed Oct 28, 2019
1 parent 44ebb00 commit 301c5d4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions google_tag.module
Original file line number Diff line number Diff line change
Expand Up @@ -234,13 +234,16 @@ function google_tag_preprocess_page(&$variables) {
$noscript = @file_get_contents($url);

if ($noscript) {
// Note: for any theme that follows the pattern of core html.tpl.php in the
// Note: for any theme that follows the pattern of core page.tpl.php in the
// system module (e.g. bootstrap theme), this does not place the snippet
// immediately after the body tag but rather after the 'skip-link' div.
$variables['page_bottom']['google_tag'] = array(
$google_tag = array(
'#markup' => $noscript,
'#weight' => -10,
);
// Since render arrays can't be passed to page.tpl.php (since it has no
// preprocess laer -- it's an anomoly) we pre-render here.
$variables['page_bottom'] .= backdrop_render($google_tag);
}

}
Expand Down

0 comments on commit 301c5d4

Please sign in to comment.