We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10226
    • 412 Posts
    I am talking about;

    <script type="text/javascript">var MODX_MEDIA_PATH = "media";</script>


    Where does this come from, how do I get rid of it (do I need it?). This is the first time I have seen this, just to be sure, I checked my google caches and it is not in there.

    ... enlighten me smiley

    Thanks!
      • 3749
      • 24,544 Posts
      It’s set in manager/includes/header.inc.php.

      It’s used in the function getTVDisplayFormat().

      Bob
        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
        • 7231
        • 4,205 Posts
        No need to worry about that. I think it has to do with the cache and left overs from a manager sessions. It will show if you are logged in as manager (i think it will show if anyone is logged in as manager, not necessarily you, but I am not sure), but if no one is logged in and the cache cleared then it should not show (but sometimes still does).

        I have seen this mentioned a few times in the forum but don’t recall a solution for getting rid of it.
          [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

          Something is happening here, but you don&#39;t know what it is.
          Do you, Mr. Jones? - [bob dylan]
          • 28436
          • 242 Posts
          Hello guys

          i just use a plugin to remove it from the source. I use it in several sites and no complains. I think its really not necessary for the frontend-show.

          event: OnWebPagePrerender
          $e = &$modx->Event;
          switch( $e->name )
          {
              case 'OnWebPagePrerender':
                  $o = &$modx->documentOutput;
                  $o = preg_replace( '|<script type="text/javascript">var MODX_MEDIA_PATH = "media";</script>|si', '', $o );
              break;
              default :
              return;
              break;
          }


          hope it helps.
          adios, Stefan