Skip navigation
Ivy54
Currently Being Moderated

The template doesn't look like the original page.

Jul 19, 2012 2:21 PM

Tags: #template #template_error

Hi,

 

When I create a template the template ends up looking like a very generic version of the original until I save it as an html file.  All the images disappear and the menu bar is missing but the words that make up the menu bar are stretched out all over the page.  The boxes I built for the content area also disappears so I can't make them an editble region.  I know this is not right because I just watched a youtube video from some guy at adobe and when he creates a template the template looks the exact same as the page:  http://www.youtube.com/watch?v=V5_-kaDZr6whttp://.  Does anyone have any idea why this happens?

 

Thanks,

M

 
Replies
  • Currently Being Moderated
    Jul 19, 2012 3:05 PM   in reply to Ivy54

    File > New Page from Template.   Choose a Template from your current site.

    SaveAs new file name.html

     

    I think what you're doing is saving your Template as a new file which doesn't work because the paths to external CSS, scripts and images will be broken.

     

     

    Nancy O.

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 20, 2012 10:42 AM   in reply to Ivy54

    Are you working within a Defined Local Site Folder? 

    Site > Manage Sites...

     

     

    Nancy O.

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 20, 2012 1:20 PM   in reply to Ivy54

    We would need to see the code in your Template (.dwt) and the code from a child page (html) spawned from that template.  The best & fastest way to get help here is to upload your pages & dependant files to your remote server space and post the URLs.  That way we can see everything.

     

     

    Nancy O.

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 20, 2012 1:45 PM   in reply to Ivy54

    Your child page isn't a child page. 

     

    The code at the top of a template child page must reference the template.dwt from which it was spawned like this:

     

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml">

    <!-- InstanceBegin template="/Templates/main.dwt" codeOutsideHTMLIsLocked="false" -->

     

    Also, main.dwt must be inside your site's Templates folder or it won't work.

     

     

    Nancy O.

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 21, 2012 5:43 AM   in reply to Ivy54

    Starting at the top, all templates must be saved in the "Templates" folder which is located at the root level of your site.  When you create a page, and use FILE | Save As Template..., DW will do this for you automatically.  If this is true, then...

     

    <!-- TemplateEndEditable -->

    <link href="_css/styles.css" rel="stylesheet" type="text/css" />

     

    this link that I see present in the template code you have posted is a curious one.  It implies that the CSS file is ALSO present at the same level as the template, i.e., it's also within the Templates folder.  But that cannot be because the Templates folder must only contain your template files, not the rest of the files for your site.

     

    So, right off the bat, there is something offkilter in your code.

     

    If you open your file "template.html" and use FILE | Save As Template..., then when prompted for a name use "main2.dwt". Now open main2.dwt, and look at that link to the CSS file - it should look like this -

     

    <!-- TemplateEndEditable -->

    <link href="../_css/styles.css" rel="stylesheet" type="text/css" />

     

    Does it?

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 21, 2012 11:35 AM   in reply to Ivy54

    Excellent.  First stop when you have problems like this is the Code view.  Even a blind squirrel will find an acorn in there occasionally.  The more you do it, the more comfortable you will be, and the more familar you will become with the 'normal' look of code....

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points