locked
Can an active .dwt file be temprarily locked to prevent auto edits to the .dwt file? RRS feed

  • Question

  • Example: I have a .dwt file with 10 .asp pages utilizing that .dwt file. If, for example, I edit one of those pages that uses a font that is NOT listed in the .dwt file, the .dwt file automatically modifies itself which in turn modifies all the other pages. I would prefer to manually check the .asp and .dwt files to see if they agree and if not to manually edit the .dwt file. Is there a way to temporarily LOCK the .dwt file so that it does not auto-correct itself so that I can keep it intact as last previously saved until I'm ready to manually modify it?

    Friday, May 23, 2014 9:42 PM

Answers

  • A DWT file does not change unless you are editing the DWT file.  There are no "auto edits" to it.  You'll need to be a lot clearer about what you are actually editing.

    Are you editing a CSS file?  If so: anything using that CSS file will obviously see the same change, and no, there is no way to prevent that.  If you have styles specific to the page, put them in an editable region in the <head> section of the page itself (this can include overriding or adding to a style in the attached CSS), or in a CSS file only attached to that page, and they will only affect that page.








    • Edited by KathyW2 Saturday, May 24, 2014 2:44 AM
    • Marked as answer by CFLOA Sunday, May 25, 2014 12:04 AM
    Saturday, May 24, 2014 2:08 AM
  • Again, you cannot edit a DWT except by editing the DWT. You are confusing that with something else you are doing. Styles you create in your page go into an editable region on the page.  Content in an editable region is not part of the DWT, it's part of your individual page.  There shouldn't be anything in an editable region that you expect to remain consistent on all pages, and changes in an editable region will not be reflected back to the DWT.  (It's not good practice to use the formatting tool bar and let EW create autotyles.  Different styles on different pages can end up with the same name, and none of the names will tell you what that style does.  Create your own styles, or at least rename autostyles to something reasonable.)

    • Marked as answer by CFLOA Sunday, May 25, 2014 12:04 AM
    Saturday, May 24, 2014 5:25 AM
  • I, too, am a programmer, and I am sure that you recognize the problem that exists when trying to debug an issue that cannot be replicated. That is the problem that we have, because in my six years of using EW, I have never encountered a circumstance in which editing an attached page caused those edits to be reflected in the DWT. Never, as in, not ever.

    Given that we are incapable of producing such a result, and know of no way to fox the system to force it to behave in such a fashion, it follows that we would know of no way to prevent it from doing so, n'est-ce pas? You seem to have a completely idiosyncratic installation of EW which permits this behavior, and you are, therefore, on your own.

    @Kathy: Using a DWT with ASP files is not that unusual (no more, that is, than using ASP files in EW with no dev server or Intellisense support). I have two sites where I have used a DWT with PHP files, which are essentially the same in character as ASP files vis-a-vis the DWT.

    cheers,
    scott


    Please remember to "Mark as Answer" the responses that resolved your issue. It is common courtesy to recognize those who have helped you, and it also makes it easier for visitors to find the resolution later.

    • Marked as answer by CFLOA Sunday, May 25, 2014 12:05 AM
    Saturday, May 24, 2014 9:51 PM
  • First I'd suggest you put your global styles in an external stylesheet and attach that to the DWT instead of using a big block of style, auto or self created in the head section which it sounds like how you are doing thing if it were possible to actually figure out your issue from your description.

    Then put an editable section in the head section of your DWT that is editable. Then if you create a page level style it will go in that editable section instead of whatever it is you are doing right now. So your head section in the DWT looks like:

    <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
    <!-- #BeginEditable "doctitle" -->
    <title>Untitled 1</title>
    <!-- #EndEditable -->
    <link href="site.css" rel="stylesheet" type="text/css" />
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
    <!-- #BeginEditable "pagestyles" -->
    <style type="text/css">
    </style>
    <!-- #EndEditable -->

    </head>

    Also use meaningful names for your styles and you won't have to worry about having the same name used and over writing the original style instead of auto-style1, auto-style2, etc.


    Free Expression Web Tutorials
    For an Expression Web forum without the posting issues try expressionwebforum.com


    • Edited by Cheryl D Wise Saturday, May 24, 2014 10:36 PM
    • Marked as answer by CFLOA Sunday, May 25, 2014 12:06 AM
    Saturday, May 24, 2014 10:35 PM

All replies

  • A DWT file does not change unless you are editing the DWT file.  There are no "auto edits" to it.  You'll need to be a lot clearer about what you are actually editing.

    Are you editing a CSS file?  If so: anything using that CSS file will obviously see the same change, and no, there is no way to prevent that.  If you have styles specific to the page, put them in an editable region in the <head> section of the page itself (this can include overriding or adding to a style in the attached CSS), or in a CSS file only attached to that page, and they will only affect that page.








    • Edited by KathyW2 Saturday, May 24, 2014 2:44 AM
    • Marked as answer by CFLOA Sunday, May 25, 2014 12:04 AM
    Saturday, May 24, 2014 2:08 AM
  • No on the CSS file. All is related to the auto-style part of the .dwt file. I have created about 20 styles for fonts so that in my .asp files I ref that particular style. But if I add a new font characteristic in my .asp file that is not in the .dwt file, the .dwt file automatically creates a new style to match that new font and the .dwt file then has a new style section and wipes out several of the original .style-xxx entries. I then have two style areas in my .dwt file... and this DOES happen automatically! Several times... and it is annoying. Fortunately a do frequent backups that I can revert to.

    <style type="text/css">
    .auto-style_new-1 {
     text-align: left;
     font-family: Arial, Helvetica, sans-serif;
     font-size: small;
     font-weight: normal;
     color: #000066;
    }

    </style>

    <style type="text/css">

    .auto-style_previous {

    text-align:right;

    }

    </style>

    Saturday, May 24, 2014 4:32 AM
  • Again, you cannot edit a DWT except by editing the DWT. You are confusing that with something else you are doing. Styles you create in your page go into an editable region on the page.  Content in an editable region is not part of the DWT, it's part of your individual page.  There shouldn't be anything in an editable region that you expect to remain consistent on all pages, and changes in an editable region will not be reflected back to the DWT.  (It's not good practice to use the formatting tool bar and let EW create autotyles.  Different styles on different pages can end up with the same name, and none of the names will tell you what that style does.  Create your own styles, or at least rename autostyles to something reasonable.)

    • Marked as answer by CFLOA Sunday, May 25, 2014 12:04 AM
    Saturday, May 24, 2014 5:25 AM
  • I understand all that and that's what I've been doing... editing my own styles. I don't intentionally let EW create autostyles, but sometimes one slips by and I manually correct it. In my .asp file, if I add a new font characteristic that I didn't realize wasn't already in the .dwt file, then yes, it also puts it in an editable area in the .dwt file and I then need to manually edit the .dwt file to move it from the editable area to the uneditable area. And yes I know that the styles I created in the uneditable area are the only styles that are consistant with other pages. Where the problem exists that you don't seem to catch or believe, is that when it puts the new font in the editable area in the .dwt file, it ALSO deletes some of the "styles" in the area that are supposedly non-editable. Now maybe it's not supposed to do that, but as a mainframe programmer for a fortune 500 company for over 20 years, I've seen many flukes happen that are not supposed to happen... that's why patches and upgrades are created. You keep saying it doesn't auto edit... I'm telling you that for some reason under whatever circumstances, IT DOES! not every time but sometimes and I haven't been able to pinpoint why. As a professional programmer, if one wants to test something, one should only make one modification at a time then check result. If one does too many, one will not know which modification caused the problem. And that's what I've done to check... add one new style to the .asp page and it adds that style to the editable DWT but sometimes also deletes styles in the non editable area which puzzles me because it shouldn't. Now, back to my original question... This has turned into an argument that shouldn't have... and I apologize for that, but all I want to know is if anyone knows if there is a way to temporarily lock or write-protect that .dwt file so that it cannot make any changes including in the editable area until I manually synchronize all that I want because when it deletes areas it shouldn't it affects all the other pages until I fix it. In any case, thank you Kathy for trying to help... I usually do very well with my programming, but am poor in terminology and often do not express myself correctly so that others might not understand clearly what I'm trying to say.

    • Edited by CFLOA Saturday, May 24, 2014 7:02 AM
    Saturday, May 24, 2014 6:55 AM
  • If editing a normal file put styles in an editable area of the DWT itself, you are seeing something no one else has ever seen, and something completely contrary to how DWTs work.  So .. I can't help you.  (Of course, using a DWT with asp files is also something I've never seen.)

    Adding, that, since DWTs don't auto-edit (with the sole exception of for you, apparently), no, there is no way to lock them.  Never in the history of this forum has there been a need for that.

    • Edited by KathyW2 Saturday, May 24, 2014 12:59 PM
    Saturday, May 24, 2014 12:35 PM
  • Thank you for trying. I'll keep testing and if I find the actual cause and solution, I'll post.

    BTW: You referenced "If editing a normal file put styles in an editable area of the DWT itself ....", I may not have been clear because I think you're assuming what you describe as a normal file, is not linked to the DWT. The .asp files I was editing are linked to the DWT so I would expect the change... just not the deletion part. 

    Thanks again

    Saturday, May 24, 2014 4:33 PM
  • By normal files I did mean the files attached to the DWT. You are seeing something completely out of the norm.
    Saturday, May 24, 2014 8:07 PM
  • I, too, am a programmer, and I am sure that you recognize the problem that exists when trying to debug an issue that cannot be replicated. That is the problem that we have, because in my six years of using EW, I have never encountered a circumstance in which editing an attached page caused those edits to be reflected in the DWT. Never, as in, not ever.

    Given that we are incapable of producing such a result, and know of no way to fox the system to force it to behave in such a fashion, it follows that we would know of no way to prevent it from doing so, n'est-ce pas? You seem to have a completely idiosyncratic installation of EW which permits this behavior, and you are, therefore, on your own.

    @Kathy: Using a DWT with ASP files is not that unusual (no more, that is, than using ASP files in EW with no dev server or Intellisense support). I have two sites where I have used a DWT with PHP files, which are essentially the same in character as ASP files vis-a-vis the DWT.

    cheers,
    scott


    Please remember to "Mark as Answer" the responses that resolved your issue. It is common courtesy to recognize those who have helped you, and it also makes it easier for visitors to find the resolution later.

    • Marked as answer by CFLOA Sunday, May 25, 2014 12:05 AM
    Saturday, May 24, 2014 9:51 PM
  • First I'd suggest you put your global styles in an external stylesheet and attach that to the DWT instead of using a big block of style, auto or self created in the head section which it sounds like how you are doing thing if it were possible to actually figure out your issue from your description.

    Then put an editable section in the head section of your DWT that is editable. Then if you create a page level style it will go in that editable section instead of whatever it is you are doing right now. So your head section in the DWT looks like:

    <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
    <!-- #BeginEditable "doctitle" -->
    <title>Untitled 1</title>
    <!-- #EndEditable -->
    <link href="site.css" rel="stylesheet" type="text/css" />
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
    <!-- #BeginEditable "pagestyles" -->
    <style type="text/css">
    </style>
    <!-- #EndEditable -->

    </head>

    Also use meaningful names for your styles and you won't have to worry about having the same name used and over writing the original style instead of auto-style1, auto-style2, etc.


    Free Expression Web Tutorials
    For an Expression Web forum without the posting issues try expressionwebforum.com


    • Edited by Cheryl D Wise Saturday, May 24, 2014 10:36 PM
    • Marked as answer by CFLOA Sunday, May 25, 2014 12:06 AM
    Saturday, May 24, 2014 10:35 PM
  • Problem Solved, possible cause and solution. (This is to supersede my previous statement that might be indicated below, as this is more informative)

    All of your comments put together have helped tremendously in solving the problem.

    So Thank you all for your help!

    1st - Not sure whether having "meta content=..." in two separate sections was important, but did so.

    2nd - Moving all my auto-styles from DWT to css certainly made for cleaner coding and probably is proper method. (I am calling them auto-styles but actually I give them unique style names such as "style-med-italic" etc)

    3rd - Embarrassingly, I discovered that my last style in the DWT was not closed with a "}", which may have been the cause for the deletions when I would edit/save a file. And this is probably why my problem was not the norm and you hadn't heard of this problem before. When I inadvertently added a font style that was not in the dwt file, it would create a new style section above the current style section and the EW probably was confused having new code with two style sections for the dwt as per this example:

    (this is where I'd have to re-edit my DWT)

    <style>

    .style_new {
     font-style: normal;
    }

    </style>

    <style>

    .style_bold {
     font-weight: bold;
    }
    .style_italic {
     font-style: italic; (notice no closing curly brace)

    </style>

    P.S. - Perhaps some of you may be old enough to remember the days when programming was displayed as 80 characters across the screen which had either green, amber or white characters on a black background monitor and some of the hardest errors to find in code were a missing period or period in the wrong place, or distinguishing between zero and letter O. My omission of the curly bracket reminded me of those days.


    • Edited by CFLOA Sunday, May 25, 2014 8:56 PM
    Sunday, May 25, 2014 8:46 PM
  • I just tried to reproduce your problem by deliberately leaving off the closing bracket in a style in the DWT, adding, modifying, duplicating style names deliberately with styles in the page in both the DWT and a page created from it and ... nope, still couldn't make a change in the page do anything to the DWT.

    Ah well, I had to see if I could reproduce it, but I couldn't.

    Perhaps you had a specific case that I didn't try.

    Monday, May 26, 2014 2:03 AM
  • Ah well... who knows... probably a combination of quirks.

    Since it didn't happen every time, could also be a specific order of steps taken such as which file I saved first... DWT or ASP or vice-versa or one of several other steps performed or not.  Anyway it's cleaned up on my system and working correctly now thanks to everyone's input. I think the most improvement was moving all the styles out of the DWT's and into the css files. Don't know why I was so blind to that in the first place... chalk it up to old age I guess. My body parts just don't bend like they used to and apparently same with my brain.

    Hopefully no one else gets same problem.

    Monday, May 26, 2014 4:54 AM
  • "My body parts just don't bend like they used to and apparently same with my brain."

    Hah!  Well, I'm not quite up to your age, but there are several of us here who are no longer spring chickens.  You have to learn the right line:  Your brain is not less flexible with age.  It's just that you now have so much in your brain, with all those years of learning and experience, that some things get pushed to the back of the cupboard and take a bit of a hunt to find.  :)


    • Edited by KathyW2 Monday, May 26, 2014 6:49 AM
    Monday, May 26, 2014 6:49 AM
  • Heh -- seems there is no such thing as a young "regular" here --



    ClarkNK, A.K.A. HomePage Doctor
    HomePageDoctor.com -- Database Tutorials
    Ownertrades.com -- Created with Expression, VWDExress, SQL Express, and ASP.NET
    Arvixe -- My favored web host

    Monday, May 26, 2014 11:23 AM