We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9996
    • 4 Posts
    Hello, all. I’m very new to MODx and CMS in general... to be honest, i’m really a graphics design person masquerading as a website developer. That means i’ll probably be around here quite often asking equally simple and childish questions. So, since i’ve resigned myself to the fate of being annoying, you may as well resign yourself to being annoyed. Therefore, first off i need to say: hey.

    Oh, and I appreciate the graciousness you’re all about to willingly display. Thanks.

    First question.. the instructions for the template I’m modifying say to create several new snippets out of the content of these several files. The snippet creation page includes in the content box the php tag (not sure what to call it) "<?php (double line break) ?>" The file does not contain a similar expression, so the question is: Do i replace that whole tag-thing, or do i leave it and add the content from the file? If I leave it in, where does the file-content belong (before, in the middle, or after?) in the phrase?
      • 10487 MODX Staff
      • 1,535 Posts
      You can replace the existing content in the snippet textarea with what’s in the files you have - as snippets are PHP code, MODx will automatically add the surrounding PHP tags if they are not present when you save the snippet.

      I’m gonna assume that the files you have are already coded to be MODx snippets - if not, you may have a few tweaks to get them functioning as snippets (in other words, where have you got this template from? Is it a template you have downloaded from the MODx resource repository smiley )
        Garry Nutting
        Senior Developer
        MODX, LLC

        Email: [email protected]
        Twitter: @garryn
        Web: modx.com
        • 9207 ☆ A M B ☆
        • 2,475 Posts
        Here’s a relevant wiki article that walks through a SUPER simple example so you can get your feet wet:
        http://wiki.modxcms.com/index.php/Snippets

        To answer your question, paste the entire php script into the field for the snippet... include the <?php and ?> tags.
          • 9996
          • 4 Posts
          thanks much! yes, the files come from the MODx repository, so they should be already formatted correctly.