We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40735
    • 119 Posts
    I've noticed recently that the markup that Chrome's Developer Tools tells me is being delivered to it is different from the markup that I have written. It seems to be minifying my JavaScript, which is cool, but it also changes the way some things in the <head> tag are written. I thought at first that it was Chrome rendering it funny but I took at look at the server response and it was the same. It doesn't do it consistently though. For instance, I'm bringing in my css like this:

    <style type="text/css">@import url("/assets/templates/ravenflight/css/ravenflight.css");</style>


    What I usually see in Chrome inside the <style> tag is the contents of the file I'm importing. I figured MODx probably recognized what I was doing and for some reason, possibly related to load times, it had gone ahead and imported that file before delivering it to the client but just now I was looking at it and the <style> tag is missing all together. In its place is a <link> tag. It works fine and I assume there's a good reason for it so I guess I don't care that it's doing it, I'm just curious about what that reason is. Anyone have any idea?
    [ed. note: dwillis210 last edited this post 14 years ago.]
      • 22303 MODX Staff
      • 10,725 Posts
      MODX itself does nothing to transform content you put into it. Perhaps you have an extra installed that is doing this?
        • 40735
        • 119 Posts
        The only extra I have installed is Wayfinder. Is Chrome perhaps not showing me the unaltered server response? Have a look for yourself: http://ravenflight.net/
        My template is a static file. The contents of this file, seen below, are not reflected in the template code field in manager.

        <!doctype html>
        <html>
        <head>
        	<meta charset="utf-8">
            <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        	<title>[[++site_name]] -:|:- [[*pagetitle]]</title>
        	<style type="text/css">@import url("/assets/templates/ravenflight/css/ravenflight.css");</style>
        	<!--[if IE]>
        		<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
        	<![endif]-->
            <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
            <script type="text/javascript" src="/assets/templates/ravenflight/js/ravenflight.js"></script>
        </head>
        
        <body>
        	<header>
        		[[!Wayfinder? &startId=`0` &outerTpl=`main-outerTpl` &rowTpl=`main-rowTpl`]]
        		<div id="info" class="info">Image data and captions will go here.</div>
        		<div class="clearFloat"><!-- clearing element --></div>
        	</header>
        	<div id="content">
        		[[*content]]
        	</div>
        	<footer>
        		
        	</footer>
        </body>
        </html>
          • 3109 ☆ A M B ☆
          • 894 Posts
          I can assure you it's not MODX it's probably Chrome trying to fix something, try using this method for importing css files.

          I looked at your site and it's missing opening and closing quotes for the text inside the url().

          Good luck.
            Benjamin Marte
            Interactive Media Developer
            Follow Me on Twitter | Visit my site | Learn MODX
            • 40735
            • 119 Posts
            See, that's what I'm talking about. You say it was missing quotes but, as you can see from the code in my previous post, it's not missing them in my template. So why is it missing them in the client?
              • 10208 ☆ A M B ☆
              • 1,780 Posts
              What happens if you change the @import css to something like this:
              <link rel="stylesheet" href="[[++site_url]]assets/templates/ravenflight/css/ravenflight.css">


              I'm also a little concerned that you say your template code isn't reflected in the code area for the manager. A static file should import into that field, if you change something in the file it should also change in the manager, and conversely, the same with the manager. Change something in the manager field, the static file should update. If this isn't occurring, something is wrong.

              Try deleting everything in the code field for the template, then chose your static file again and save the template. Does it show up? Try copying the template code, and paste into the code field in the template. Does it stick?

              If you continue to have issues, make a new template and try again. I've seen resources not work at times no matter what I do, and the only option was to make a new one, which typically works fine. It stands to reason that a template resource could also be gorked in some way.

                Frogabog- MODX Websites in Portland Oregon
                "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
                Having server issues? These guys have MODX Hosting perfected - SkyToaster
                • 3749
                • 24,544 Posts
                Be careful. If the static link is set up correctly, deleting the content in the Manager and saving will wipe out your file. Be sure it's backed up somewhere.


                ------------------------------------------------------------------------------------------
                PLEASE, PLEASE specify the version of MODX you are using.
                MODX info for everyone: http://bobsguides.com/modx.html
                  Did I help you? Buy me a beer
                  Get my Book: MODX:The Official Guide
                  MODX info for everyone: http://bobsguides.com/modx.html
                  My MODX Extras
                  Bob's Guides is now hosted at A2 MODX Hosting
                  • 22427
                  • 793 Posts
                  deleting the content in the Manager and saving will wipe out your file
                  This indeed is a trap I fell into a few times...
                    • 3749
                    • 24,544 Posts
                    I lost a plugin that I'd worked on for days that way once. wink

                    Hopefully, we've learned our lesson.


                    ------------------------------------------------------------------------------------------
                    PLEASE, PLEASE specify the version of MODX you are using.
                    MODX info for everyone: http://bobsguides.com/modx.html
                      Did I help you? Buy me a beer
                      Get my Book: MODX:The Official Guide
                      MODX info for everyone: http://bobsguides.com/modx.html
                      My MODX Extras
                      Bob's Guides is now hosted at A2 MODX Hosting
                      • 10208 ☆ A M B ☆
                      • 1,780 Posts
                      Quote from: BobRay at Oct 03, 2012, 06:16 PM
                      Be careful. If the static link is set up correctly, deleting the content in the Manager and saving will wipe out your file. Be sure it's backed up somewhere.


                      Doh! There I go saying it'll be changed if you change it in the manager... and in the same breath suggest to change it and see if it comes back.

                      Serious Homer moment for me. Good catch Bob.
                        Frogabog- MODX Websites in Portland Oregon
                        "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
                        Having server issues? These guys have MODX Hosting perfected - SkyToaster