webhoes Posted October 20, 2017 Posted October 20, 2017 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>
rick Posted October 20, 2017 Posted October 20, 2017 I don't think <DIV> elements are valid children of <HEAD>. Element names may be the same, but IDs should be unique. 3
Pixrael Posted October 20, 2017 Posted October 20, 2017 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> 3
webhoes Posted October 20, 2017 Author Posted October 20, 2017 @Pixrael I did no know this method. But it works perfectly. I also removed the double title id. Was there by mistake I guess...
Pixrael Posted October 20, 2017 Posted October 20, 2017 yes, off course you are right about the ids.. I only change the div for the pw-region tags
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now