Copy link to clipboard
Copied
I am having heacdache-inducing problems with Dreamweaver and the templates feature.
I have created updated templates that will be deployed next year, but have had problems with the previous templates as well. I seem to have two problems happening.
The first is where if I save my template file after making changes, for some reason when it updates the child pages, it places
<!-- InstanceBegin template="/Templates/template_gcwebtest_public_e.dwt" codeOutsideHTMLIsLocked="false" -->
at the very start of the document, before <!DOCTYPE html>. This of course causes problems. This occurs without me even needing to open the child pages in Dreamweaver.
The second problem is if I do open a child page in Dreamweaver, for some reason the </head> tag gets moved to before the <!-- InstanceBegin..--> tag. So on the new template it goes at the very start of the document, and on the old template the <!-- InstanceBegin..--> is in a spot that doesn't cause issues, but the </head> tag before it does.
For my new template, this is the "Before" code at the start:
<!DOCTYPE html>
<!--[if lt IE 9]><html class="no-js lt-ie9" lang="en" dir="ltr"><![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js" lang="en" dir="ltr">
<!--<![endif]--><head>
<!-- TemplateInfo codeOutsideHTMLIsLocked="false" -->
<meta charset="utf-8">
And once I open the child page in Dreamweaver, this is what I get:
</head><!-- InstanceBegin template="/Templates/template_gcwebtest_public_e.dwt" codeOutsideHTMLIsLocked="false" --><!DOCTYPE html>
<!--[if lt IE 9]><html class="no-js lt-ie9" lang="en" dir="ltr"><![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js" lang="en" dir="ltr">
<!--<![endif]--><head>
<meta charset="utf-8">
The commented [if] code is in the old template and should not affect anything. If someone needs the full code for both tamplates, I can drop them into a post.
Why are these tags moving around? Isn't the point of a template for everything but the editable content to stay put? I am using version CS 5.5, as my department can only license the most recent version from Adobe, and I do not like the newer versions with the poorly implemented Search and Replace (thatt's another discussion).
Copy link to clipboard
Copied
Copy link to clipboard
Copied
1. As far as I can tell, the code is error free (pages validate with the W3C Validator after I put <!-- InstanceBegin..--> back where it belongs
2. That step did stop the <!-- InstanceBegin..--> but seems to have fixed the problem with the </head> tag that I mentioned in my opening post.
Copy link to clipboard
Copied
As Nancy has implied, you do have errors in your code causing Dreamweaver to go balistic. Because you seem to be convinced that there are no errors, we could help you out, but only when we are privvy to the code. Either supply a link to the site or paste the contents of the template here.
Copy link to clipboard
Copied
The Dreamweaver version I have at work is CS 5.5, which goes crazy when I work with templates. The version I have at home is CC 2015. I sent the files to myself at home and tried them out. CC 2015 does not do screwy things with the code like I see at work. So at this point I am convinced it's Dreamweaver itself.
Here is an example of a page where I use my template. There should be no errors as it passes W3C validation. If you compare it to https://wet-boew.github.io/themes-dist/GCWeb/content-en.html, there should not be much if any difference apart from additional meta tags, defining the editable areas, and change to the breadcrumb.
Copy link to clipboard
Copied
I have created a child page from the template and cannot replicate the problem
I am not sure what relevance the second link has, as this is not a child page of a template.
Copy link to clipboard
Copied
The second page is just to compare the code to the template. It's what the template is based on.
You might be able to replicate the problem if you try it with Dreamweaver CS 5.5. I could not replicate the problem at home either running a newer version of the program.