7 Replies Latest reply: Sep 25, 2011 8:40 AM by Alykhan2 RSS

    <!-- InstanceBegin template="" codeOutsideHTMLIsLocked="false" --> Problem

    Alykhan2 Community Member

      Hi,

       

      I'm trying to add the following line as the first line in my php file.

       

      <?php session_start(); ?>

       

      For some strange reason everytime I try and add that to my php files they get wiped out when I update the template.  I have the following code in my template.

       

      <!DOCTYPE html>
      <head>
      <!-- TemplateInfo codeOutsideHTMLIsLocked="false" -->

      etc..

       

      In my templates this is always the first line

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

      <?php  include("config.php");

      ?>
      <!DOCTYPE html>
      <head>

       

       

      Why can't I add anything above and why is this the first line?

        • 1. Re: <!-- InstanceBegin template="" codeOutsideHTMLIsLocked="false" --> Problem
          MurraySummers ACP/MVPs

          For some strange reason everytime I try and add that to my php files they get wiped out when I update the template.  I have the following code in my template.

           

          ...

           

          In my templates this is always the first line

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

          <?php  include("config.php");

          ?>
          <!DOCTYPE html>
          <head>

           

          First of all, the code you show above is not from a Template, it's from a child page.  Please confirm that you have taken it from your Template page, and whether you are in fact using nested Templates.

           

          Second, the code you are showing is completely borked.  It could never be like that without user 'intervention'.  It *should* be like this -

           

           

          <?php  include("config.php");

          ?>
          <!DOCTYPE html>

          <html>

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

          <head>

           

          Was that a typo? If not then we need to fix things.

          • 2. Re: <!-- InstanceBegin template="" codeOutsideHTMLIsLocked="false" --> Problem
            mexicomapmaker Community Member

            This same issue has been bugging me for a long time. The exact same code comes from a brand new page,

            made from a brand new template. No, nothing is nested.

             

            In the template the page is based on, this line does not exist. However, when I make a new page from template, it appears. There is no user intervention or user altering of the code. The line is greyed out, so cannot be deleted. I am trying to simply write some html in the page, not any php.

             

            If you paste the line into Google, you will get dozens if not hundreds of results, mostly other people with this line in the code of their page. In other words, you will see their page and if you look at the source, it is there, at the top line. So I do not think it is isolated.

             

            Sometimes it prevents me from inserting anything (text, images etc.) into a page (that I was able to edit fine before). I get the message about 'nested editable regions' but nothing was done to alter the code produced by DW in making the template. It is frustrating and an answer would be appreciated.

             

            If anyone has a real solution to this problem, it would be most welcome.

            • 3. Re: <!-- InstanceBegin template="" codeOutsideHTMLIsLocked="false" --> Problem
              MurraySummers ACP/MVPs

              If anyone has a real solution to this problem, it would be most welcome.

               

              That line only means something to DW.  It is the default value, and it is placed in EVERY template child page, which is why you find oodles of instances on Google.  It *should* be there.  It doesn't prevent you from adding anything to your page.

               

              But the code that you have shown in your previous posts is a bit confused.  Can you please show us the top 20 lines of code on your TEMPLATE page?

              • 4. Re: <!-- InstanceBegin template="" codeOutsideHTMLIsLocked="false" --> Problem
                Alykhan2 Community Member
                <!-- InstanceBegin template="Templates/dashboard.dwt.php" codeOutsideHTMLIsLocked="false" --><?php
                include("config.php");
                ?>
                <!DOCTYPE html>
                <!--[if IE 7 ]>   <html lang="en" class="ie7 lte8"> <![endif]-->
                <!--[if IE 8 ]>   <html lang="en" class="ie8 lte8"> <![endif]-->
                <!--[if IE 9 ]>   <html lang="en" class="ie9"> <![endif]-->
                <!--[if gt IE 9]> <html lang="en"> <![endif]-->
                <!--[if !IE]><!--> <html lang="en"> <!--<![endif]-->
                <head>

                 

                <meta charset="utf-8">
                <!--[if lte IE 9 ]><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"><![endif]-->

                 

                <!-- iPad Settings -->
                <meta name="apple-mobile-web-app-capable" content="yes" />
                <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
                <meta name="viewport" content="user-scalable=no, initial-scale=1.0, width=device-width">
                <!-- iPad End -->
                <!-- InstanceBeginEditable name="doctitle" -->
                <title><?php echo($_SESSION['business_name']); ?> - Admin Dashboard</title>
                <!-- InstanceEndEditable -->
                <link rel="shortcut icon" href="favicon.ico">

                 

                 

                 

                 

                ------

                 

                Here is the thing.  I keep having to add this line after I update the template because it gets wiped out.

                 

                <?php session_start(); ?>

                 

                before the <!-- InstanceBegin ....... -->

                 

                This is the first time I am seeing this behaviour in Dreamweaver.  I have dozens of sites that use templates yet its only this one that exibits this behaviour.

                • 5. Re: <!-- InstanceBegin template="" codeOutsideHTMLIsLocked="false" --> Problem
                  Alykhan2 Community Member

                  OOOOps sorry you wanted the template page. Here it is.

                   

                  <!DOCTYPE html>
                  <!--[if IE 7 ]>   <html lang="en" class="ie7 lte8"> <![endif]-->
                  <!--[if IE 8 ]>   <html lang="en" class="ie8 lte8"> <![endif]-->
                  <!--[if IE 9 ]>   <html lang="en" class="ie9"> <![endif]-->
                  <!--[if gt IE 9]> <html lang="en"> <![endif]-->
                  <!--[if !IE]><!--> <html lang="en"> <!--<![endif]-->
                  <head>

                   

                  <meta charset="utf-8">
                  <!--[if lte IE 9 ]><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"><![endif]-->

                   

                  <!-- iPad Settings -->
                  <meta name="apple-mobile-web-app-capable" content="yes" />
                  <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
                  <meta name="viewport" content="user-scalable=no, initial-scale=1.0, width=device-width">
                  <!-- iPad End -->
                  <!-- TemplateBeginEditable name="doctitle" -->
                  <title><?php echo($_SESSION['business_name']); ?>Admin Dashboard</title>
                  <!-- TemplateEndEditable -->
                  <link rel="shortcut icon" href="../favicon.ico">

                   

                  <!-- iOS ICONS -->
                  <link rel="apple-touch-icon" href="../touch-icon-iphone.png" />
                  <link rel="apple-touch-icon" sizes="72x72" href="../touch-icon-ipad.png" />
                  <link rel="apple-touch-icon" sizes="114x114" href="../touch-icon-iphone4.png" />
                  <link rel="apple-touch-startup-image" href="../touch-startup-image.png">
                  <!-- iOS ICONS END -->

                  • 6. Re: <!-- InstanceBegin template="" codeOutsideHTMLIsLocked="false" --> Problem
                    MurraySummers ACP/MVPs

                    Just for grins take all of the conditional comments away from the space between the doctype and the <head> tag in the template page, and replace them with a simple <html> tag.  See what happens then.  I'm betting DW doesn't quite know what to do with that kind of content.

                    • 7. Re: <!-- InstanceBegin template="" codeOutsideHTMLIsLocked="false" --> Problem
                      Alykhan2 Community Member

                      Hi,

                       

                      Yup that was it.  Sorry for the late response as for some strange reason I'm not getting alerts.  Is this a bug?  Any workaround?