Forum Moderators: open
The only "editable regions" in the template are doctitle, head and body.
When the template is applied to a page the dialogue box showing inconsistent regions appears, and I define head as head and body as body.
The template is applied; head and body are fine, but existing page titles are replaced by the text I’ve used in the template.
I don’t recall having this situation with the previous template, but I can’t seem to work out what needs to be done so that existing page titles remain in place.
What am I doing wrong/not understanding here?
Thanks.
Syzygy
<!-- InstanceBegin template="/Templates/Template New.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>My title text here</title>
<!-- InstanceEndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- InstanceBeginEditable name="head" -->
<meta name="Description" content="My description here" />
<meta name="Keywords" content="My keywords here />
<style type="text/css">
</style>
<!-- InstanceEndEditable -->
</head>
<body>
<!-- InstanceBeginEditable name="Editable body region" -->
<!-- InstanceEndEditable -->
</body>
<!-- InstanceEnd -->
Anything wrong here?
First, you should avoid using filenames that have spaces in them -- such as "Template New.dwt"
Second, you should avoid using names for editable regions that are the same as standard html tags -- such as "head"
And finally, I've always avoided using multi-word editable region names with spaces (such as "Editable body region"). I don't know if this would cause any problems, but my policy is always to avoid anything that might possibly confuse DW or cause a problem.
<!-- InstanceBegin template="/Templates/Templatenew.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>My title text here</title>
<!-- InstanceEndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- InstanceBeginEditable name="tags" -->
<meta name="Description" content="My description here" />
<meta name="Keywords" content="My keywords here />
<style type="text/css">
</style>
<!-- InstanceEndEditable -->
</head>
<body>
<!-- InstanceBeginEditable name="stuff" -->
<!-- InstanceEndEditable -->
</body>
<!-- InstanceEnd -->
When applying this to an existing page the dialogue box identifies inconsistent regions as:
document body - <not resolved>
document head - <not resolved>
So what I've done is:
Move content to new region ->
document body - <stuff>
document head - <tags>
As editable regions <doctitle> and <tags> are both within <head></head>, does this create a problem or conflict?
Syzygy
This is looking like a conundrum -- I'm not sure what the problem is.
Let's try something, to narrow down whether it's a template issue or a child page issue. Create a new page from your template - New -> From Template, and place some content in it. Edit the title. Save it. Now make some minor harmless change to your template, save it, and have it update child pages. Then check your new child page and see if the title tag has been overwritten by what's in the template.
If the title tag in the child page has been overwritten, then there's a problem with the template, and I'll want to see the full template code. (Change any private information, of course.)
If the title tag hasn't been overwritten, then the template and your new child page are working exactly as supposed to, and the problem is with your existing child pages, and I'll want to see the full template code and the full code from one of the existing child pages.
I’m now at that frustrating stage where I can’t see the wood for the trees and have no idea what I’m doing any more (not that I was particularly clued up before). What was slightly annoying a couple of days ago, has now become an all-consuming source of frustration – aaarrgh! I’d swear that there’s a nefariously mischievous gremlin within DW having a laugh at my expense!
I expect though that the endless tinkering I’ve been doing in an attempt to find a solution to something that’s probably very straightforward and is staring me in the face (hopefully), has caused more problems than I had to start with!
I’ve done as suggested and can report that the problem appears to crop up when the template is added to existing child pages. Here then is the template code as it is presently:
------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<!-- TemplateBeginEditable name="doctitle" -->
<title>Page title here</title>
<!-- TemplateEndEditable -->
<!-- TemplateBeginEditable name="tags" -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Robots" content="all">
<meta name="MSSmartTagsPreventParsing" content="true">
<meta name="Description" content="Page title here: ">
<meta name="Keywords" content="keywords here,here,and here">
<!-- TemplateEndEditable -->
<style>
@import url("../wwwroot/css/filename.css");
@import url("../wwwroot/css/nameoffile.css");
</style>
</head>
<body>
<!-- TemplateBeginEditable name="maincontent" -->
[main content here]
<!-- TemplateEndEditable -->
<script>G’s Analytics Here
</script>
</body>
</html>
------------------
Below is the code from a current child page that has yet to have the template added:
------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Page title here</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="Description" content="Page title here:">
<meta name="Keywords" content="keywords here,here,and here">
<style type="text/css">
@import url("css/filename.css");
@import url("css/nameoffile.css");
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Robots" content="all">
<meta name="MSSmartTagsPreventParsing" content="true">
</head>
<body>
[main content here]
<script>G’s Analytics here
</script>
</body>
</html>
------------------
Need anything else? I’ll happily provide.
Thanks for taking the time to help. It's very much appreciated.
Syzygy
The best, most surefire way to apply the template to all the existing pages is also quite inefficient -- create a new page from the template, then copy-and paste the existing code from each page into the appropriate editable areas in the new template-based page. Yes, you would have to do that for each page in the site. How many pages are you needing to apply the template to? There is another way, but it's fraught with danger unless you're very careful. If you only have a few pages you need to do this with, it's better to just spawn new pages from the template and copy-and-paste. If you have a lot of pages, we'll get into the faster, but more dangerous method.
But I have an important question first: It appears that your template holds nothing but the "housekeeping" code in the head section, and and G Analytics code at the end. Why are you bothering to apply a template to these pages? Is all of the sitewide structural code and global navigation going to be in the editable area of each individual page? It seems to me there's no real reason to bother applying a template to every page. I don't see any advantage here in what you're doing.
This is my first attempt at working with template pages in DW, and, whilst I agree that there's little or no advantage to having a template on the pages at present, at some stage extra elements will need to be added to pages and I'm hoping I'll have saved myself some time by having made the effort to template at an early stage. Well, that's the theory - the practice may be somewhat different. :-)
Thanks again.
Syzygy
[edited by: Syzygy at 3:23 pm (utc) on Aug. 20, 2007]