Jump to content

rendering <head> template strategy


webhoes
 Share

Recommended Posts

Hello,

I am using the latest template strategy. For some page I use Id and class to replace or append content to a div.

When checking the output I noticed that for the div's that are located between <head></head> the output is generated in between <body></body>

I can't figure out why? Does any one know?

 

<?php namespace ProcessWire ;?>
<!DOCTYPE html>
<html lang="nl">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- Title of this page -->
    <div id="title-region"><title id="title-region"><?php echo $page->title; ?> | <?php echo $page->template->name; ?> | schildpad | Chrysemys</title></div>


    <link rel="stylesheet" href="<?php echo \AIOM::CSS(array('styles/bootstrap.css', 'styles/font-awesome.css', 'styles/chosen.min.css', 'styles/prettyPhoto.css',
        'scripts/responsive-menu/component.css', 'styles/svg-icons.css', 'styles/typography.css', 'styles/jquery.auto-complete.css', 'styles/shortcodes.css'
    , 'styles/colors.css', 'styles/style.css', 'styles/responsive.css')); ?>">

    <!-- Global site tag (gtag.js) - Google Analytics -->
    <script async src="https://www.googletagmanager.com/gtag/js?id=UA-108091260-1"></script>
    <script>
        window.dataLayer = window.dataLayer || [];
        function gtag(){dataLayer.push(arguments);}
        gtag('js', new Date());

        gtag('config', 'UA-108091260-1');
    </script>


    <div id="google_map"></div>

    <meta name="description" content="<?php echo $page->summary; ?>" />

    <meta property="og:locale" content="nl_NL" />
    <meta property="og:type" content="website" />
    <meta property="og:title" content="<?php echo $page->title; ?> | Chrysemys " />
    <meta property="og:description" content="<?php echo $page->summary; ?>" />
    <meta property="og:url" content="<?php echo $page->httpUrl; ?>" />
    <meta property="og:site_name" content="Chrysemys" />
    <meta property="og:image:secure_url" content="<?php if(count($page->images)) echo 'https://chrysemys.nl' . $page->images->first()->size(1200,630)->url; ?>"/>
    <meta property="og:image" content="<?php if(count($page->images)) echo 'https://chrysemys.nl' . $page->images->first()->size(1200,630)->url; ?>"/>


</head>

 

 

 

 

 

Link to comment
Share on other sites

Don't use div element in the document head, it's incorrect.. instead use this Processwire markup region option

<pw-region id="title-region">
  <title id="title-region"><?php echo $page->title; ?> | <?php echo $page->template->name; ?> | schildpad | Chrysemys</title>
</pw-region>
...
<pw-region id="google_map"></pw-region>

 

  • Like 3
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...