We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 11677
    • 14 Posts
    i have used many different cms in my time and this looks lovely but i just don’t get how you are supposed to use snipits.
    it seems like a very clumsy way to do addons.
    same goes for modules.

    OK so here is an example - i have installed jot to the area of snipits it needs
    then I’ve got to manually add code to a new snippit bit in the manager
    then I’ve got to add some code [[Jot? &customfields=`name,email` &subscribe=`1` &pagination=`10`]] somewhere...

    but where
    i like the fact that there is lots of documentation and you do go into detail but i would have though (after looking around a bit) that these kinda instructions are quite important for people to want to take up this ace looking cms?

    sorry if i sound all shouty on my first post - i am just a bit frustrated i guess

    /edit - i will shut my whining - i just gotta find time to read the docs i guess.... sorry
      • 37550 ☆ A M B ☆
      • 711 Posts
      onesmarthost Reply #2, 20 years ago
      Hi,

      Modx is quite sweet once you get used to it, took me a while to work out how to write snippets just learning modules at the moment.

      To use a snippet just create a page and in the editor where you would type in the page content put the snippet call in ie.

      [[Jot? &customfields=`name,email` &subscribe=`1` &pagination=`10`]]

      So if i was creating a page and wrote the html source manually in the editor it would be like

      <h1>Wonder if this works!</h1>
      <p> text could go here to explain this page </p>
      [[Jot? &customfields=`name,email` &subscribe=`1` &pagination=`10`]]
      <p> more text can go here</p>

      hope that helps
        http://www.onesmarthost.co.uk
        UK MODX Hosting with love.
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        Don’t feel bad, it takes a bit of getting used to, and can be quite frustrating at first.

        Think of snippets as <?php ... ?> blocks that get inserted into the HTML code. Except a lot more flexible. MODx is just using its own templating tags, and the output of a tag is inserted exactly where you place the tag.

        Once you get your mind wrapped around the principles, you’ll be shocked at how simple the concept is, and how powerful the execution is.

        Yes, at this point the creation/installation of snippets, templates, etc is a little primitive. Personally I prefer it that way, but in time we’ll develop an auto-installer system for those who didn’t cut their computing teeth on the command line and line editors!

        Perhaps the most confusing thing to start with is the terminology as it refers to the different "types" of MODx content.

        Snippets [[...]] are blocks of PHP code that act on your site’s web pages. Placeholders [+ .. +] are just markers where the output of a snippet’s PHP code is saved to be displayed wherever the placeholder tags are put.

        Chunks {{ ... }} are blocks of HTML that are used repeatedly in your site’s web pages, and are kept in chunks for ease of maintenance.

        TVs [* ... *] are like a cross between snippets and chunks in that they can contain PHP code when using @EVAL, plain HTML code, and a whole lot more functionality using other @ - bindings.

        Plugins are external units that intercept the document parser at a given point to perform custom manipulation of the document being generated.

        Modules are external units that add custom functionality to the Manager.

        Plugins and modules make it possible to customize MODx to do anything you want without having to modify the core code.
          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