6 Replies Latest reply on Jul 28, 2011 2:24 PM by JR7PT

    Code locked by template error

    JR7PT

      I know this has cropped up before, I've worked my way through many threads but haven't found a solution that works, so I wonder if there are any other possible solutions.

       

      The problem is that I created a css and a template in DW, then put a couple of editable areas into the template (on top of the 2 DW puts in automatically), used the template to create a basic page but - lo and behold - when I want to edit anything in any of the editable areas I get "Making this change would require changing code that is locked by a template or translator.  The change will be discarded."

       

      I'm using DW v6.0.

       

      I've had my html file validated by the W3C validator; I've tried changing the "charset" in my meta tag to 'utf-8'; I've deleted all my sites from DW, started a new site and created new css and template files; I've moved an <h1></h1> tag from outside an editable area into it as DW seemed unhappy about their positioning; but nothing seems to make any difference so I've reversed my changes for the moment.

       

      In the hopes that someone can spot something I'm not seeing here's the code from the top of my template.  The site isn't live yet (for obvious reasons) so I can't give you a url.

       

      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
      
      "http://www.w3.org/TR/html4/loose.dtd">
      <html lang="en">
      <head>
      <!--TemplateInfo codeOutsideHTMLIsLocked="true"-->
      <!-- TemplateBeginEditable name="doctitle" -->
      <title>pagetitle</title>
      <!-- TemplateEndEditable -->
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
      <!-- TemplateBeginEditable name="head" -->
      <!-- TemplateEndEditable -->
      <link href="../cssfiles/LEMcss.css" rel="stylesheet" type="text/css">
      </head>
      <body>


      Immediately after this is some html and javascript which makes up the 'freefind' search engine for the site.  I've tried removing this and it doesn't cure the problem.

       

      Thanks for looking.

        • 1. Re: Code locked by template error
          MurraySummers Level 8

          I'm using DW v6.0.

           

          Start the ominous base fiddles!  DW 6.0 was well populated with dragons.  At the least you must update it to DW6.1!  Right away.  Don't hesitate.

           

          In the hopes that someone can spot something I'm not seeing here's the code from the top of my template.  The site isn't live yet (for obvious reasons) so I can't give you a url.

           

          There's no reason you can't save the template, upload it, and post a link - makes no difference that the site isn't live.  If there is no link to that page, it cannot be found.

           

          Why do you have this code in your template?

           

          <!--TemplateInfo codeOutsideHTMLIsLocked="true"-->

           

          Remove it and see what happens.  It's ONLY needed if you want to make the region above the <html> tag, or below the </html> tag non-editable.  In most cases you wouldn't want to do that.

          • 2. Re: Code locked by template error
            JR7PT Level 1

            Murray

             

            Thanks for your reply.  To take your points in order:

             

            I found the DW6.1 updater on the Adobe site, ran it, it crashed and I no longer have a functioning DW installation - when I try to open DW I get Javascript error messages and it closes again, so until I get it back up and running my problems with DW are fairly academic.

             

            The template is at http://www.rushworthfamily.co.uk/LEMtemplate.html.  I've uploaded the css as well.

             

            The "HTML is Locked" code is in my template because at some point in the last week or 10 days I got a message from DW telling me I needed to insert it, so I did.

             

            Now I'm off to look for my DW disks.

             

            John

            • 3. Re: Code locked by template error
              MurraySummers Level 8

              I found the DW6.1 updater on the Adobe site, ran it, it crashed and I no longer have a functioning DW installation - when I try to open DW I get Javascript error messages and it closes again, so until I get it back up and running my problems with DW are fairly academic.

               

              Read the FAQ for this forum and follow the instructions about deleting your WinFileCache file.

               

              The "HTML is Locked" code is in my template because at some point in the last week or 10 days I got a message from DW telling me I needed to insert it, so I did.

               

              You misread that message - it didn't tell you that you needed it.  It told you that *if* you want that region to be treated as non-editable, you need it.  I admit it's a bit confusing, but you would only need it in few cases.

               

              The template is at http://www.rushworthfamily.co.uk/LEMtemplate.html.  I've uploaded the css as well.

               

              OK - looking at it now....

              • 4. Re: Code locked by template error
                MurraySummers Level 8

                I don't see anything on that page which would cause the alert to be thrown.  However, there is much in that code to not like.  For example -

                 

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

                 

                This CSS file link implies that the CSS file is in the Templates folder.  That should never be done.  The only thing that should be in the Templates folder is the *.dwt templates themselves.

                 

                All links in a TEMPLATE file should be one of three kinds -

                1.  Relative to the template file, e.g.,

                <a href="../ (meaning that you must go up one level from the template folder

                to reach the root of the site, hence all other files, since none of them

                should be in the templates folder)

                2.  Relative to the site root, e.g.,

                <a href="/ (meaning that one would begin looking for the linked file at the

                root of the site and follow the pathing from that point)

                 

                3.  Absolute, e.g.,

                 

                <a href="http:// (meaning that the link is to a page external to the site).

                 

                <a  id="ffrclose" style="z-index:6;

                 

                Static elements do not carry a z-index.

                 

                <div  id="ffresult_2" style="z-index:7; position: relative; height: 100%; background-color:white;  display:block;">

                 

                A div is already a block tag.

                 

                And an absolutely positioned iframe is a pretty unusual page usage....

                 

                <div  id="ffresult_btm" style=" position:absolute; bottom:-1;

                 

                You need units on that -1 => -1px; would do....

                 

                <a href="../html%20files/SiteMap.html"

                 

                It's never a good idea to use spaces in your file/folder names.

                1 person found this helpful
                • 5. Re: Code locked by template error
                  JR7PT Level 1

                  Hi Murray

                   

                  Sorry, the link to the css file is my fault, I altered it when I uploaded the two files, in the actual site design it will be in a separate folder called cssfiles.

                   

                  The code including the z-indices, display:block; and the absolutely positioned iframe was generated by 'freefind' to put the search box on my site.  I haven't done anything with it but insert it into the page.  The iframe displays the search results.  I have tried with all the generated code removed but DW still doesn't let me edit the editable areas so, although the code may be messy I didn't think it was causing the problem.

                   

                  I've taken on board what you say about spaces in file and folder names and will make adjustments accordingly.

                   

                  Still working on getting DW up and running again.

                   

                  I really appreciate the time you're spending on this.

                   

                  John

                  • 6. Re: Code locked by template error
                    MurraySummers Level 8

                    Good luck, John.  Let us know how you get on please.