Skip to main content
Inspiring
June 19, 2022
Answered

I can no longer edit source code in template file.

  • June 19, 2022
  • 2 replies
  • 725 views

I was trying to add a canonical tag in an "editable region".  At first it worked well, but for some reason started giving me errors. I removed the editable region and wanted to attempt it again. Now I cannot edit the code at all. It is greyed out, and I cannot touch it. Please advise how to fix this. 

    This topic has been closed for replies.
    Correct answer B i r n o u

    Yes, it was my bad. It happened after I edited it. Not sure what I did. It could have been simple. I may have commented it out. 


    think to get back up in a secure place of all your DWT and LBI files... just in case

    2 replies

    B i r n o u
    Community Expert
    Community Expert
    June 20, 2022

    Some times when using templates, and worth when the local website remained inactive for a long time.. quite a few artifacts or inappropriate or unexpected behaviors can occur.. so to resolve it, one have to reapply the template itself (DWT) to the child pages that we want to edit...

    two ways for that purpose...

    soft method, from the top right contextual menu of the assets palet (template  sub icon on the left side) , use recreate the web site sub menu

    hard method, drag and drop the template from the assets panel, over the display view of the child template

     

    Inspiring
    June 20, 2022

    Thanks very much. I was able to resolve it. Issues keep coming up so all advice is welcome. The WC3 code check is invaluable. 

    Nancy OShea
    Community Expert
    Community Expert
    June 19, 2022

    I don't know what you did to your Template.dwt or why it's not editable but if I had to guess, I'd say you damaged the code in some way. 

     

    Templates are very particular documents.  The code syntax and structure are critical for them to work on Child pages.  Do you have a backup of your original Template.dwt that you can revert to?

     

    Nancy O'Shea— Product User & Community Expert
    Inspiring
    June 19, 2022

    I uploaded a previous version from the remote server, which did the trick. I was also able to add a canonical tag. I figured out I only need one editable region for meta tags and similar. You're right about the syntax. I may have "commented out" the document. I have since created a page that doesn't have any CSS or HTML errors, according to W3C.  I used a bootstrap navbar, but I coded my own CSS in external sheets. I used media queries to change size of text and photos.  Could you have a look? thanks: 

    https://www.drct.com/radiation-detectors/ranger.html

     

    Nancy OShea
    Community Expert
    Community Expert
    June 19, 2022

    Bootstrap works out of the box without any custom CSS.  I fear your random efforts to customize styles without understanding how Bootstrap works has messed things up.

     

    Bootstrap is a 12-box grid layout system with a precise container, row, column structure, none of which you're using BTW.

     

    <!DOCTYPE html>
    <html lang="en">
    <head>
      <title>Bootstrap 4 Example</title>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/css/bootstrap.min.css">
    
    </head>
    <body>
    
    <div class="jumbotron text-center">
      <h1>My First Bootstrap Page</h1>
      <p>Resize this responsive page to see the effect!</p> 
    </div>
      
    <div class="container">
      <div class="row">
        <div class="col-sm-4">
          <h3>Column 1</h3>
          <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit...</p>
          <p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris...</p>
        </div>
        <div class="col-sm-4">
          <h3>Column 2</h3>
          <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit...</p>
          <p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris...</p>
        </div>
        <div class="col-sm-4">
          <h3>Column 3</h3>        
          <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit...</p>
          <p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris...</p>
        </div>
      </div>
    </div>
    
    <script src="https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.slim.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/js/bootstrap.bundle.min.js"></script>
    </body>
    </html>
    

     

    I can't force you to do anything you don't want to do.  But at this point in your learning, I think it would help you to focus more on structure and less on style.  Structure effects functionality and usability.  Style is merely eye candy.

     

    Nancy O'Shea— Product User & Community Expert