We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27376
    • 576 Posts
    I created a patch that adds a parameter to the [tt]regClientCSS[/tt] function to allow the media="" tag. If nobody has any objections I’ll commit it to 095dev branch. The second parameter is optional of course smiley
    Index: manager/includes/document.parser.class.inc.php
    ===================================================================
    --- manager/includes/document.parser.class.inc.php	(revision 2457)
    +++ manager/includes/document.parser.class.inc.php	(working copy)
    @@ -2157,14 +2157,14 @@
         }
     
         # Registers Client-side CSS scripts - these scripts are loaded at inside the <head> tag
    -    function regClientCSS($src) {
    +    function regClientCSS($src, $media='') {
             if (isset ($this->loadedjscripts[$src]) && $this->loadedjscripts[$src])
                 return '';
             $this->loadedjscripts[$src]= true;
             if (strpos(strtolower($src), "<style") !== false || strpos(strtolower($src), "<link") !== false) {
                 $this->sjscripts[count($this->sjscripts)]= $src;
             } else {
    -            $this->sjscripts[count($this->sjscripts)]= '<!-- MODx registered -->' . "\n" . '  <link rel="stylesheet" href="' . $src . '" />';
    +            $this->sjscripts[count($this->sjscripts)]= '<!-- MODx registered -->' . "\n\t" . '<link rel="stylesheet" type="text/css" href="'.$src.'" '.($media ? 'media="'.$media.'" ' : '').'/>';
             }
         }
    
      • 22303 MODX Staff
      • 10,725 Posts
      Sounds like a great addition to me...
        • 25663 MODX Staff
        • 12,272 Posts
        Yes, please commit away. But also please strip out the <!-- modx registered --> bit too. smiley
          Ryan Thrash, MODX Co-Founder
          Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
          • 27376
          • 576 Posts
          Quote from: rthrash at Mar 23, 2007, 06:38 PM

          Yes, please commit away. But also please strip out the <!-- modx registered --> bit too. smiley
          That’s what I’d like to get rid of (it’s gone in my working copy) but I didn’t commit those changes since I wasn’t sure if people wanted it there or not...

          I’ll remove them.

          UPDATE: Commited as rev 2462
            • 25663 MODX Staff
            • 12,272 Posts
            Feel free to remove "markers" at will. smiley
              Ryan Thrash, MODX Co-Founder
              Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me