We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34162
    • 1 Posts
    Can anyone help me out please?

    Using MODx 0.95

    Why do I find: <script type="text/javascript">var MODX_MEDIA_PATH = "media";</script> in the source code?

    What is this for and is it possible to remove it without affecting any parts of the system?

    I have found the document that renders this code into the source: manager/includes/tmplvars.format.inc.php (line 13)

    Im not a PHP’r and sadly have to say im stumped embarrassed

    If theres anyone out there that could help I would appreciate it

    Cheers
      • 25663 MODX Staff
      • 12,272 Posts
      Easiest solution: upgrade to 096.
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 34162
        • 1 Posts
        Thanks Ryan for the direct answer, sadly that is not a solution that I can use.
          • 25663 MODX Staff
          • 12,272 Posts
          Why is that?

          Pulling the modx media path out of 095 files I think was scattered about multiple locations, and certain TVs need it in 095.
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • 27376
            • 576 Posts
            If you’re not using the ticker, marquee, or floater TV widgets, it’s probably safe to comment out that line. If a Foundation member says otherwise though, listen to them, not me smiley
              • 2690
              • 148 Posts
              i upgraded to 096 but still have <script type="text/javascript">var MODX_MEDIA_PATH = "media";</script> in the head.
              tried to clean cache and remove locks - didnt help.

              i dont mind having it there, but if i can remove it i would like to do that.

              Aleks
                MODx Revo 2.0.6-pl (Traditional) | Apache 2.2.3 | PHP 5.2.14 | MySQL 5.0.77 | MAC OS 10.6.5 | FF 3.6/Chrome 9.0.5
                • 27376
                • 576 Posts
                Quote from: bakalek at Jul 30, 2007, 12:53 PM

                i upgraded to 096 but still have <script type="text/javascript">var MODX_MEDIA_PATH = "media";</script> in the head.
                tried to clean cache and remove locks - didnt help.
                Version 0.9.6 doesn’t remove this line of code.Quote from: rthrash at Jul 16, 2007, 07:41 AM

                Pulling the modx media path out of 095 files I think was scattered about multiple locations, and certain TVs need it in 095.
                It is possible to hack the core to remove it, but some TVs require that this variable be there, plus any upgrade you make to MODx will erase any changes you make to the core.
                  • 2690
                  • 148 Posts
                  super ..the code stays in smiley

                  Aleks
                    MODx Revo 2.0.6-pl (Traditional) | Apache 2.2.3 | PHP 5.2.14 | MySQL 5.0.77 | MAC OS 10.6.5 | FF 3.6/Chrome 9.0.5
                    • 25663 MODX Staff
                    • 12,272 Posts
                    The TVs in 096 *shouldn’t* need that in them any longer as they’ve been ported to mootools... or did some get missed sirlancelot?
                      Ryan Thrash, MODX Co-Founder
                      Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                      • 24414
                      • 45 Posts
                      Quote from: sirlancelot
                      It is possible to hack the core to remove it

                      ...but you don’t need to - create a plugin to fire OnWebPagePrerender, add the code:

                      $output = $modx->documentOutput;
                      $remove = '<script type="text/javascript">var MODX_MEDIA_PATH = "media";</script>';
                      $replace = '';
                      $modx->documentOutput = str_replace($remove, $replace, $output);
                      


                      ...and you’re done.