We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14163
    • 4 Posts
    I would consider myself a fairly proficient coder, and recently, due to the volume of sites I now have to take care of needed a better solution than manual coded updates, cue modx.

    I have succesfully installed and have the default template working. What i need to achieve is be able to bolt CMS or WYSIWYG sections into particular pages, or create new pages that rely on user submitted content which have the same CSS etc as the main site. Now, am i being a complete retard but I just dont understand, looked at the documentation and (maybe I have missed it) it mentions nothing about for example "insert your own css", "step 1 do this,step 2 do this"

    I will eventually integrate comment / blog / gallery / calender plugins etc but, lol I just need to know how the hell I start the process off.
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      The css is specified in the template, which is a skeleton HTML document with bog-standard HTML tags like <head> and <link rel="stylesheet...>.

      http://www.sottwell.com/how-templates-work.html

      It’s actually too simple; a lot of first-time users are confused because they expect something much more difficult!
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 3749
        • 24,544 Posts
        Sottwell’s template page is an excellent place to begin. You can also look at the site in my sig for a general overview of MODx and advice on porting existing sites to MODx.

        BTW, shouldn’t the subject line for this thread end with a question mark? wink
          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
          • 14163
          • 4 Posts
          Question mark - it does now, thank you both for your help i will let you know how i get on
            • 14163
            • 4 Posts
            just working away now - when building my snippets and chunks presumably i can make a reference to a file on my server for example

            <? php
            http://www.mysite/include/myfile.php
            ?>

            so that when I change this main site file the modx sections update based on these changes?
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              If you want a snippet to simply contain a line for including an external file, do it like this:
              <?php
              include 'path/to/file.php';
              
              $output = $included-files-output;
              return $output;
              // or just return; if no need for output
              

              You can use this method for templates, snippets, chunks, plugins and modules. It’s an excellent way to reduce the load on the site cache file too.

              There is a rather exhaustive discussion on "good form" for creating snippets here http://wiki.modxcms.com/index.php/Creating_Snippets

              Keep in mind that snippets are processed through the eval() function, so they may not always behave as expected.
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 14163
                • 4 Posts
                hahahahahahahaha brillinat it really is that simple, wow i am impressed!!!!!!!

                thank you for your help everyone, i will now start on integrating plugins / chunks / snippets etc.

                Any advice on the best event calendar, which one????