We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8394
    • 24 Posts
    A couple of days ago I copied all MODx development stuff from my internal server to the "real" host server. Everything looked fine: I was able to log in and see all my files and stuff and the home page showed up correctly in my browser, etc. I even navigated to the home page from another computer to make sure it looked OK to someone coming in from "outside" (i.e. not logged in to MODx). Everything was just as it was supposed to be.

    Since then I haven’t changed anything on the host site. Tonight I pointed my browser to the hosted home page and... suddenly! All formatting is gone. It’s a plain white screen with plain text for the menu and nothing else. It’s as though it isn’t seeing the style sheet. I checked the template stored for the home page and it is still OK... the reference to the style sheet file name is just as it was, with the correct path, etc. And I looked at the style sheet file itself... it’s still there and still looks just the same as it did when I first uploaded it (when it worked).

    Anyone have any theories as to what may have changed, why it’s no longer seeing my style sheet, what I can do to fix it and/or how to prevent this from happening again?

    Many thanks!

    - Dave
      • 8394
      • 24 Posts
      A quick update...

      On the host site I changed the template to point to a different name for the CSS, then went and renamed the CSS to that new name. Now it works!

      I thought of this because of a behavior I observed on my development machine last night. I was going along merrily tweaking things in the style sheet and seeing my changes each time I "previewed" (or navigated directly to the site with my browser).

      Suddenly, however, none of my changes were being reflected in the preview. I tried everything imaginable and the final preview page looked just as it had before my changes; as though the css had been cached and MODx was no longer reading the actual file. Logging out and back in did nothing to clear this up, and navigating to the home page from another computer showed the same CSS settings as before my changes. The only thing that finally cleared it up was to do the same thing I did just now on the remote site: rename the CSS file and point to the new name in the template. That cleared it up completely, and I was subsequently able to get back to making changes to the (renamed) style sheet and see those changes reflected immediately each time I previewed the home page.

      Is this possibly a bug or is there some legit behavior that I’m unaware of, but that I really NEED to know about?

      Thanks again,

      - Dave
        • 8394
        • 24 Posts
        Sorry, I should also have included about configuration.

        I just downloaded MODx about a week ago and I THINK I have version 1.0.0. My internal web server is Apache (and I believe the host server is the same). My internal OS is Ubuntu (not sure of version) and the external server is some flavor of Linux but I’m not sure which. Both have PHP5... not quite sure about versions of MySQL but I think they’re fairly current. I’ll have to figure out how to locate all of this info. Sorry for being a bit vague.

        - Dave
          • 16183
          • 1,390 Posts
          Sometimes clearing the MODx and the browser caches is all it takes to see your changes effected...

          cheers/k
            • 8394
            • 24 Posts
            @Kongondo - Thanks for the quick reply. Say, aren’t you in the UK? Isn’t it about 2:30 in the morning over there? Oh yeah... that’s when I get most of my work done, too! laugh

            I just copied my latest changes up to the host site and found a similar problem was happening... this time it was seeing the style sheet from just before I uploaded the newest copy. I tried clearing the MODx cache but that didn’t help. I’m not sure how to clear the browser cache (I’m using Firefox, so I can look that up in the help files). But when I encountered the problem earlier this evening it was after having turned my workstation off and back on again, so I would have thought that would have cleared the cache. I didn’t try connecting from another computer but I’ll try that the next time I see the problem. Come to think of it, though, I DID try that last night when I was getting this problem on the internal development server, and the other computer also was seeing the old version of the style sheet, not the one with my changes. Weird. Anyway, I’ll keep watching for this and report if I observe anything else that might shed any light.

            By the way, I’ve been greatly enjoying reading through your Wayfinder tutorial. Excellent, excellent writing! Having done a fair bit of technical writing myself, I can really appreciate the incredible amount of work you put into that. It’s also very well explained, with just the right amount of detail at each stage to be understandable, though I still have to work at it! Many thanks for putting that out there for the MODx community.

            Best regards,

            - Dave
              • 16183
              • 1,390 Posts
              Dave,

              Ye, am pretty much nocturnal wink

              About your problem, it could be a path issue. Have you set a base path in your site template? i.e.
              <base href="[(site_url)]"></base>


              Is the problem evident in other browsers? Maybe post your site template code here too so that we can have a look.

              In Firefox, you can clear the cache via the Tools menu. There should be a keyboard shortcut too, I should think.

              I’m glad you are finding the WF guide helpful and thx for your kind comments.

              cheers/k
                • 8394
                • 24 Posts
                Hi again!

                Yes, I would normally suspect the path, too... except that it works fine for a while and then abruptly STOPS working without my changing anything that should affect the path. And, if I simply change the file name (and the reference to it in the template) then it starts working... again nothing that should affect the path.

                What it LOOKS like is as though it were caching the style sheet in the database and then periodically "forgetting" to go check if the style sheet file has been changed (even if the "copy" in the database got cleared out). This scenario (which I assume is impossible, so I’m discussing it only as a theoretical version to see if there’s something else going on that could somehow be equivalent to it) would explain (a) sometimes not getting the updated changes to the CSS file, (2) other computers navigating to the same site and seeing the same, erroneous results, (3) the styles suddenly "disappearing" for everyone (even though the file is still there and correctly referenced... I looked in the source code that the browser received and it, too, correctly referred to the CSS file name in the correct location), and (4) why renaming the file got it working again (the "cached" version no longer reflected the name in the template).

                As I say, I assume this sequence of events is not possible given the underlying structure of modx, so I’m still a bit puzzled as to exactly what actually IS happening!

                I greatly appreciate your help!

                Regards,

                - Dave
                  • 20413
                  • 2,877 Posts
                  What happens to me sometimes when using "include template from file" snippets, is that I store copies of the template in both file
                  and in the database. Normally I create the template in the database (Elements -> Templates) re-name it to name_OLD to call the file
                  from a new template...

                  Could it be you mixed it up this way? laugh
                    @hawproductions | http://mrhaw.com/

                    Infograph: MODX Advanced Install in 7 steps:
                    http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

                    Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
                    http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
                    • 14930
                    • 70 Posts
                    I had problems with IE6 & IE7 not understanding
                    <base href="[(site_url)]"></base>
                    thus not seeing the CSS files, so I had to change it to
                    <base href="http://www.siteurlhere.com"></base>
                    , which is of course not as flexible a solution but, well, now it works.
                      • 15083
                      • 697 Posts
                      But the browser will never see <base href="[(site_url)]"></base>
                      They will only see <base href="http://mysiteurl.com"></base> after the page has been parsed.

                      ???

                      I have had problems using apache where symbolic links are in use (IE for stopgap domains)
                      The urls would be in the form: http://myhost.com/~myusername/
                      Using the siteurl was not working for me as it was seeing the site as: http://myhost.com/