We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26799
    • 177 Posts
    The tile says it all, I’d like to be able to write information to the <head> like eform. is this a modx.document.parser function or somethin that was custom created in eform?
      • 30223
      • 1,010 Posts
      eForm makes use of API functions in the document parser.

      <?php
          //adding CSS to the head of the document
          $modx->regCLientCSS($src);
          //$src can either be a path to a css file, a plain text block starting with "<style" or a 
          //fully formed "<link src=.../>" link tag.
      
      
          //adding script to the head of the document
          $modx->regClientStartupScript($src [, $plaintext]);
          //$src can be either a path to a script or a string of plain text - either by setting
          //the optional $plaintext param to 'true'  or if  the string starts with  <script
      
      ?>
      


      This can be used in your snippets or other modx script resources. Although the list is not yet comprehensive it’s worth having a look at the API info in the wiki. While you’re there also have a look at some coding guidelines for writing snippets.
        • 26799
        • 177 Posts
        oh... you are one sweet guy, thank you for the URLs. The modx community is the best, there isn’t any support like it anywhere else. You guys are never rude or snobby, and you know your code. Excellent!
          • 25663 MODX Staff
          • 12,272 Posts
          Bah! Go away! RTFM!

          (j/k) tongue
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • 26799
            • 177 Posts
            hahaha, awesome. That behavior is not becoming a founder Ryan... :’(
              • 25663 MODX Staff
              • 12,272 Posts
              LOL smiley
                Ryan Thrash, MODX Co-Founder
                Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me