9 Replies Latest reply on Feb 16, 2010 11:13 AM by savladai

    Creating a page from a template

    savladai

      I'm new to DW and this forum but have been using GoLive for years - all the way back to PageMill!! :>) I don't remember when I started using templates but I've been doing so for years as well. However, DW has me bamboozled.

       

      I built a page with head section, footer and main body copy, saved it as a normal html page, then opened it back up and did a Save As to a .dwt file. I selected the main body content (including its <div> tags) and did the Insert Editable Region step. The resulting code in the template is:

       

      <head>

      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

         <meta name="robots" content="index, all, follow" />

          <meta name="copyright" content="Website design copyright Savladai Enterprises 2010." />

          <meta name="keywords" content="dog show supplies, pet supplies, dog dishes, dog crates, obedience dumbbells, pet accessories, dog bowls, dog trainers, professional dog handlers, pet products, dogs, pets"

       

       

          <!-- TemplateBeginEditable name="doctitle" -->

          <title>Pridmores Pet Supplies</title>

          <!-- TemplateEndEditable -->

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

          <!-- TemplateBeginEditable name="head" -->

          <!-- TemplateEndEditable -->

      </head>

       

      <body>

       

      <div id="container">

        <div id="header">

          <h1> Pridmores.com</h1>

          <h3> Your Place To Shop For Pet Supplies</h3>

        <!-- end #header --></div>

       

      <!-- TemplateBeginEditable name="MainBody" --> etc.

       

      Right off the bat I question why the TemplateBeginEditable name=head area starts at the end of the head section instead of at the very beginning but that's the least of my worries.

       

      My problem arises (or probably more accurately gets worse) when I go New>from Template. Without touching a thing, just viewing the source code, this is what I see:

       

      <head>

      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

         <meta name="robots" content="index, all, follow" />

          <meta name="copyright" content="Website design copyright Savladai Enterprises 2010." />

          <!-- InstanceBeginEditable name="doctitle" -->

          <meta name="keywords" content="dog show supplies, pet supplies, dog dishes, dog crates, obedience dumbbells, pet accessories, dog bowls, dog trainers, professional dog handlers, pet products, dogs, pets"

       

       

          <!-- InstanceBeginEditable name="doctitle" -->

          <!-- InstanceBeginEditable name="doctitle" -->

          <meta name="keywords" content="dog show supplies, pet supplies, dog dishes, dog crates, obedience dumbbells, pet accessories, dog bowls, dog trainers, professional dog handlers, pet products, dogs, pets"

       

       

          <!-- InstanceBeginEditable name="doctitle" -->

          <title>Pridmores Pet Supplies</title>

          <!-- InstanceEndEditable -->

          <link href="file:///Helen's MacBook Pro/Documents/*WEB PAGE STUFF/Pridmores/pridmore.css" rel="stylesheet" type="text/css" />

          <!-- InstanceBeginEditable name="head" -->

          <!-- InstanceEndEditable -->

      </head>

       

      <body>

       

      <div id="container">

        <div id="header">

          <h1> Pridmores.com</h1>

          <h3> Your Place To Shop For Pet Supplies</h3>

        <!-- end #header --></div>

       

      <!-- InstanceBeginEditable name="MainBody" --> etc.

       

      What on earth is going on with the not only mis-placed but duplicated InstanceBeginEditable tags? I haven't tried fixing the page yet, although I'm fairly sure I can do it myself. I'm just totally amazed that things would get moved around so drastically when saving from a template. Why would this happen and is there anything I can do to stop it. I don't want to have to go into each page and fix all the errors every time I make a page from the template. If I *don't* fix it all, I can't save any changes to the child pages because DW just tells me there are errors in the template.

       

      This is so totally bizarre.

        • 1. Re: Creating a page from a template
          Zabeth69 Level 5

          First, make sure your original page was properly created, with a DOCTYPE, etc. You can make a blank page, then steal the code from the top of the page. Paste it in above your head tag, if you don't already have that matter up there. Here's the top of the page of one of my simple templates:

          <!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">
          <head>
          <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
          <!-- TemplateBeginEditable name="doctitle" -->
          <title>MenuBar Analysis</title>
          <!-- TemplateEndEditable -->

          This is what I see at the top of a child page made from this Template:

          <!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/analysisTemplate.dwt" codeOutsideHTMLIsLocked="false" -->
          <head>
          <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
          <!-- InstanceBeginEditable name="doctitle" -->
          <title>MenuBar Analysis</title>
          <!-- InstanceEndEditable -->

          If you are not seeing this kind of code, you may have skipped a step. Go back to your original page and instead of doing a "normal" Save As and using a Template suffix, do a Save As Template, if that is not how you did it the first time. You will know if you did it correctly, because DW will create a Templates folder and asked if you want to update the links. Say "yes," of course.

           

          Your question

          Right off the bat I question why the TemplateBeginEditable name=head area starts at the end of the head section instead of at the very beginning but that's the least of my worries.

           

          Your entire head area is never made editable, but there is a section that remains editable so you can attach stylesheets and other auxiliary files, as well as any internal styles and javascript that you create that need to be in the head. The Template is created assuming you want the DOCtype etc. to be stable and unchanging in the child pages.

           

          I can't tell why your template seemed to put in extra 'begin editable' doctitle areas.

           

          When you save this child page as an html page, what happens to the code? Just as the links that point to your hard drive should resolve to relative links, the extra 'begin editable' areas might go away. I never consider a child page an actual page until it has been saved.

           

          Keep in mind that a Dreamweaver Template is not just a cookie cutter from which you make other pages. It also keeps track of your site file structure and links, correctly applying them no matter where in your site you save the new pages. But it can only do that if it is appropriately constructed in the first place.

           

          Best,

          Beth

          • 2. Re: Creating a page from a template
            savladai Level 1

            Zabeth69 wrote:

             

            First, make sure your original page was properly created, with a DOCTYPE, etc.

             

            Yes, it does. I didn't bother copy/pasting in the DOCTYPE stuff, since I thought that would overload my question but DW put exactly what you quoted.

            If you are not seeing this kind of code, you may have skipped a step. Go back to your original page and instead of doing a "normal" Save As and using a Template suffix, do a Save As Template, if that is not how you did it the first time.

            That's exactly how I did it. As I mentioned, I'm brand new to DW so was following the "manual" step by step, detail by detail.

             

            Your entire head area is never made editable, but there is a section that remains editable so you can attach stylesheets and other auxiliary files, as well as any internal styles and javascript that you create that need to be in the head. The Template is created assuming you want the DOCtype etc. to be stable and unchanging in the child pages.

             

             

            OK - that makes sense.

             

            I can't tell why your template seemed to put in extra 'begin editable' doctitle areas.

             

            When you save this child page as an html page, what happens to the code? Just as the links that point to your hard drive should resolve to relative links, the extra 'begin editable' areas might go away. I never consider a child page an actual page until it has been saved.

             

            What I pasted in originally WAS from the child page. However, as I was typing a detailed reply to this, it dawned on me that I had inserted my own <meta-tag> line into the original (brand new) page I built and saved as index.html. I'd also inserted the link to the style sheet manually, by typing in source up in the <head> area. I started again from scratch only this time I dug around (for 10 minutes or more!) to find how to attach an external style sheet. In GoLive one simply clicks on the "staircase" icon on the page and up pops the link window. I finally discovered that I had to choose the external style sheet *when I made the brand new page* - no linking to it after the fact (I chose Blank - HTML - None when building the page), so I did that, dumped in the content from my previous version, saved it, then saved as a template and told DW where to put the editable region. When I made a new page from *that* template, the "editable" tags all behaved themselves.

             

            Now I see why there was so much wailing on the GL list when people were converting over to DW. :>) The logic in DW is VERY different to that in GL but I know I'm going to have to switch over at some point because I'm using GL CS, which is practically an antique now so is going to stop working at some point.

             

            Thanks for your reply, Beth. I appreciate you taking the time to answer my question and even though you didn't give me the direct answer you DID get me thinking in the right direction. Thanks so much!

            • 3. Re: Creating a page from a template
              savladai Level 1

              I'm still struggling 4 or 5 hours later, trying to get the template to work w/o throwing in extraneous "begin editable" areas. It doesn't matter what I do, if I try to include meta tags in the header area, the file breaks. I've made another half dozen template files, after starting from scratch with a DW-made blank page (also half a dozen times) and as long as I don't put in any meta tags, the pages seem to work. This is driving me crazy and I'm at the point of giving up and just praying that my GoLive lives forever. That would be a shame, actually, because I've already found a few things in DW that I like over GL but DW will be totally useless to me if I can't include metatags.

               

              Does anyone have any suggestions on how I can get metatags into the documents without the template breaking? This happens to be a rather small site, so not using a template wouldn't be a big deal but I have other sites which would have to be converted to DW and they are MUCH too large to have to change, for instance, a navbar, in each page individually.

               

              I've added the metatags to a brand new (non-template) file and then Saved As Template from that page (after closing and re-opening it to make sure it's still ok). Then I've opened the resulting .dwt file and all is as it should be but as soon as I make a page from that template I immediately get the error message reported before. A look at the code shows that it's taken the metatags line and shoved it into the InstanceBeginEditable name="doctitle" area - TWICE!! Then there's the normal InstanceBeginEditable name="doctitle" area, followed by the blank editable head area, followed by the body stuff.

               

              Any insight into this problem will be greatly appreciated.

              • 4. Re: Creating a page from a template
                Zabeth69 Level 5

                Sure: put the meta-tags in the editable area in the head. That should not break it. It's okay if they're in the "doctitle" area, as long as they are not between the "title" tags. That's just the name for the editable area, not a restriction on content.

                 

                Beth

                • 5. Re: Creating a page from a template
                  Zabeth69 Level 5

                  Part of asking and responding to questions in the Forum is prompting thinking, both on the asker's and the responder's part.

                   

                  So keep asking and keep thinking!

                   

                  Sorry it's so painful to go from GoLive to DW. Keep at it, it's worth it!

                   

                  Beth

                  • 6. Re: Creating a page from a template
                    savladai Level 1

                    Zabeth69 wrote:

                     

                    Sure: put the meta-tags in the editable area in the head. That should not break it.

                     

                    I did that but it broke as well. I've gone back and started from scratch over and over again, putting the metatags in different places. As long as I don't use a template, I can work along just fine. Everything stays where I (or DW) put it and the pages work. If I try to include the metatags in a template, they're fine in the template but break as soon as I try to use the template.

                     

                    It's okay if they're in the "doctitle" area, as long as they are not between the "title" tags. That's just the name for the editable area, not a restriction on content.

                    I don't think I tried putting them in that particular area, so I'll go and try that and report back. I just looked at the "creation" date on my GL CS app and it's 1990-2003. That's ancient and I can see the writing on the wall for its demise. However, if I can't use templates in DW it might as well be ancient as well and I'll have to try to find something else to use. I'm already using CSSEdit for the stylesheets but I do like the WYSIWYG ability to drag images onto the design view of a page, so I don't have to type the whole name in source. It's so much faster and I don't want to give it up!

                     

                    Thanks again, Beth. I'll keep trying but I have to admit I'm reaching my limit of patience. :>)

                    • 7. Re: Creating a page from a template
                      savladai Level 1

                      Part of asking and responding to questions in the Forum is prompting thinking, both on the asker's and the responder's part.

                       

                      So keep asking and keep thinking!

                       

                      I've figured out what the problem was and I feel SO stupid!! I've stared and stared and stared at those pages but totally missed the fact that there was a missing /> at the end of the keywords list!!! As soon as I put that back in, everything works just fine. Whew!

                      Sorry it's so painful to go from GoLive to DW. Keep at it, it's worth it!

                       

                      Thanks Beth. While, as I've said before, I do see some things I like, there are a lot of things I could do in GoLive easily but can't do in DW. For example, in GoLive one can click on the popup menu of an open page, choose Template from that menu and then choose to apply a different template and bingo - the page changes. For the life of me I couldn't find where to do that, which is part of the reason it's taken me all day to trouble shoot this because I couldn't just swap out the various templates I'd made.

                       

                      Things like that I really miss. I also can't find anywhere in the prefs to tell DW to only upload modified files. I see that it only DOES upload modified files if I watch the status window as it's uploading but it wastes so much time looking at all the files to decide for itself which files need to be uploaded (put). Because I figure I'm having a good day when I can remember my own name, I don't dare upload manually because I'd forget something for sure. :>)

                       

                      Thanks for your help, Beth!

                      • 8. Re: Creating a page from a template
                        Zabeth69 Level 5

                        Features that I like regarding uploading files:

                         

                        Synchronize (at the top of the Files Panel)...you can get DW to compare your online site and your local site and show you the files that are different, either bringing down or putting up newer pages. Synchronize Previews the "difference" list and allows you to change your mind about uploading individual files.

                         

                        The small menu at the top right of the Files Panel.
                        If you choose edit, you can Select

                        1. All Files
                        2. Checked Out Files
                        3. Newer Local Files
                        4. Newer Remote Files
                        5. Recently Modified Files (you choose the 'how recent' in number of days or give a bracketed time period)
                        6. Invert Selection (if you're looking for all the files that are NOT checked out, newer local, newer remote, or recently modified)

                         

                        You can upload files one at a time from the Document Window, and decide whether to upload dependent files or not (use the up/down arrows at the top of the window on the Document Toolbar)

                         

                        It is possible to detach a Template from a page and Attach a different Template. Look in the Modify > Templates menu. One caveat there is that if editable areas do not correspond, content might have 'no place' to go. I admit I've used this warily, but it could be just what you're looking for.

                         

                        Beth

                        1 person found this helpful
                        • 9. Re: Creating a page from a template
                          savladai Level 1

                          Thanks for your tips, Beth. I've been trying to reply for a while now but the site wouldn't let me do so until now.

                           

                          One can switch templates in GL and if it has any "questions" about editable areas it gives a list of the available ones you can choose from. Pretty slick and it works well. :>)

                           

                          I've flagged your suggestions so that I can find them easily the next time I make a foray into DW. :>)