• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 536
  • Last Modified:

Dreamweaver template from page not rendering css

Hi,

I have an html page that I have created in Dreamweaver. I wanted to save it as a template. When I do that, I remove the "main content" that was in that page and insert and editable region in it's place. I then create a new page from template and it when I preview it, it's like it's not rendering the css file. The page should be in the center, but instead it starts at the left side of the screen. It's also not showing the css styles, etc. It's strange really, because it's like it's picking up some of it, but not all of it. Any ideas??
0
savache27
Asked:
savache27
  • 5
  • 4
2 Solutions
 
Jason C. LevineNo oneCommented:
Check the template file and the child file to see if the path to the CSS was changed properly.  When you create a template, the DWT file is saved in /Templates off the site root so any calls to CSS also need to be updated.

In other words, it is not uncommon to see:

../style.css

in the DWT and then also see:

Templates/styles.css

in the child file due to a bug in DW pathing.  If this is the case, simply change the template so it uses a root-relative path and not a document-relative path, i.e.:

/style.css
0
 
savache27Author Commented:
Okay, it's weird because the child file is saving like this at the top:

<!-- InstanceBegin template="/Templates/index_test.dwt" codeOutsideHTMLIsLocked="false" --><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">


<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<!-- Enter your site's description inside the content value below. Search Engine's will display this text in their results. -->
<meta name="Description" content=""/>
<!-- Enter your site's keywords inside the content value below. Choose words/acronyms that describe your site. -->
<meta name="Keywords" content="US Army, Army, Army News, ARMY.mil, Headlines, Public Affairs, Official Army Homepage, Hot Topics, Images, Video, Audio, AMP, Social Media, Leaders, History, Organization, Service, AKO"/>
<!-- InstanceBeginEditable name="doctitle" -->

Open in new window


If I copy the code and move this part

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

below this

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

Then it seems to work. What am I doing to cause it to save like that?
0
 
Jason C. LevineNo oneCommented:
Not sure.  What does the DWT code look like?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
savache27Author Commented:
This is the .dwt code:

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


<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<!-- Enter your site's description inside the content value below. Search Engine's will display this text in their results. -->
<meta name="Description" content=""/>
<!-- Enter your site's keywords inside the content value below. Choose words/acronyms that describe your site. -->
<!-- TemplateBeginEditable name="doctitle" -->
<title>Title</title>
<!-- TemplateEndEditable -->
<link rel="stylesheet" type="text/css" href="../css/root2.css"/>
	<!--[if IE 6]>
	    <link rel="stylesheet" type="text/css" href="rv4_css/ie6.css" />
	<![endif]-->
    <!--[if IE 7]>
        <link rel="stylesheet" type="text/css" href="rv4_css/ie7.css" />
    <![endif]-->
    <script type="text/javascript" src="../js/utility.js"></script>
    <script type="text/javascript" src="../js/jquery-1.2.6.min.js"></script>
    <script type="text/javascript" src="../js/superfish.js"></script>
    <script type="text/javascript" src="../js/jquery.hoverIntent.min.js"></script>
    <script type="text/javascript" src="../js/jqueryui.slide.min.js"></script>
    <script type="text/javascript" src="../js/dropDown.js"></script>
    <!-- TemplateBeginEditable name="head" -->
    <!-- TemplateEndEditable -->
</head>
<body>
    <div id="wrapper"><div id="container">
        <div id="header">
            <a id="headerStar" href="http://www.test.com/"></a>
        </div>
        
     <!--  TOP NAVIGATION        <div id="navBar">
            <ul id="dropDownNav">
                <a class="hide2" href="#skipNav">Skip main navigation</a>
				
              <li><a href="index.asp">Home</a></li>
              <li><a href="">Link</a>
                  <ul>
                      <li><a href="">Sub-Link</a></li>
                      <li><a href="">Sub-Link</a></li>
                  </ul>
              </li>
              <li><a href="">Link</a>
                  <ul>
                      <li><a href="">Sub-Link</a></li>
                      <li><a href="">Sub-Link</a></li>
                  </ul>    
              </li>
              <li><a href="">Link</a>
                  <ul>
                      <li><a href="">Sub-Link</a></li>
                      <li><a href="">Sub-Link</a></li>
                  </ul>
              </li>
              <li><a href="">Link</a>
                  <ul>
                      <li><a href="">Sub-Link</a></li>
                      <li><a href="">Sub-Link</a></li>
                  </ul>
              </li>
              <li><a href="">Link</a>
                  <ul>
                      <li><a href="">Sub-Link</a></li>
                      <li><a href="">Sub-Link</a></li>
                  </ul>
              </li>
		    </ul>
                      <a name="skipNav"></a>
      </div> -->
       
        <div id="contentBackground"><div id="leftCol">            
           
        <div id="mainContent"><!-- TemplateBeginEditable name="EditMain" -->
        
        <!-- TemplateEndEditable -->

        </div>
        <!-- end mainContent -->
        
        
    </div>
        
        <div id="footer">
            
        <div id="footerLeft">
                <a class="rss" href="http://www.test.com/rss/"><span class="textLink">RSS</span></a>
                <a class="podcasts" href="http://www.test.com/rss/podcasts/"><span class="textLink">Podcasts</span></a>
            </div>
            <div id="footerMiddle">
                   <ul>
          <span id="disclaimer"><span id="disclaimer2">*</span>The appearance of hyperlinks does not constitute endorsement.</span>
         
          </ul><br/>
                <ul>
<li><a href="http://www.test.com/508.htm" target="_blank">Section 508</a></li>
                    <li><a href="http://www.test.mil/notice.htm" target="_blank">Security and Privacy Policy</a></li>
                    <li><a href="">Contact Us</a></li>                  
                </ul>
                </div>
            <div id="footerRight">
                Need help? Try <a href="http://www.help.com/info/a-z/">A-Z</a>
         
            </div>
        </div>


            
    </div><!-- end container -->
    <!--Last Updated starts here-->   
      <div class="date">
        Last Updated: <!-- #BeginDate format:Am3 -->09/10/2012<!-- #EndDate -->
      </div><br/>
      <!--Last Updated ends here-->
</div><!-- end wrapper --></body>

</html>

Open in new window

0
 
savache27Author Commented:
Hmm...I redid the template and now it seems to be working. I really dislike using templates, but apparently I'm not going to be able to make server side includes work.
0
 
Jason C. LevineNo oneCommented:
Hmm...I redid the template and now it seems to be working

That sometimes fixes it.  Just know in advance that templates are buggy as hell (and always have been) and keep a log of fixes that you got to work.
0
 
savache27Author Commented:
I know. I really don't even want to use it. For now, it's just a simple two page site, but I'm sure it can expand. Some of the sites are huge and use Dreamweaver templates. I really wanted to use the include, but when I tried to use it with .html it wouldn't work. It worked with .asp, however...I couldn't see a preview in Dreamweaver when I used asp files. Every time I tried to preview on our web draft server it asked me to save the file. When I would run it on the production server the .asp include files would work. So, I have no idea what the issue is with that. Thanks for the advice. I appreciate your help.
0
 
Jason C. LevineNo oneCommented:
If you are prompted to save an asp file when browsing to it then the preview server isn't running IIS or IIS isn't configured correctly.
0
 
savache27Author Commented:
Thanks for all your help. I really appreciate it.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now