We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23516
    • 2 Posts
    pixilliontom Reply #1, 18 years ago
    Hey,

    I’ve only recently started using snippets and I can’t seem to find any decent documentation on them. I’m currently working on DittoCal...I’ve changed it so uses the description variable instead of the createdon date so that I can have events that last several days and appear on more than one day of the calendar by just using a comma separated list of dates. I’m now trying to change it so that it works off a template variable, the problem is I don’t know how to access them inside a snippet. In this instance I really need them to appear in the JSON output. I’ve had a look at changing the JSON class and I can get it to output some more text, but again I hit the same problem of not knowing where template variables are stored within modx. I’ve seen a couple of examples hitting the database to get them, is this the only way is there something way more simplified along the lines of $modx->templatevars?

    Of anyone knows of any good documents/guides on snippets that would also be ace.

    Cheers,

    Tom
      • 16183
      • 1,390 Posts
      Hi Tom,

      I see this is your first post. Welcome!  grin

      Hope I’ve understood your query. There’s some decent documentation on snippets in general and the modx API in the modx wiki. I suppose that is what you are looking for? For DittoCal, have never used it so don’t know  rolleyes

      Here’s the links to the wiki

      http://wiki.modxcms.com/index.php/Category:API_Function
      http://wiki.modxcms.com/index.php/API:DBAPI
      http://wiki.modxcms.com/index.php/Creating_Snippets

      For other documentation about using modx, there’s stuff here and there but we have been assured that changes are coming soon encompassing better documentation and other exciting stuff (there’s a lot of hard work behind the scenes to make this a reality). However, my experience has been most stuff is already here in the forums - it’s just scattered about. With a good combination of search terms using the google search above you are bound to get what you are looking for. Otherwise, just hola. People are nice, friendly and very helpful in the modx forum/community as you’ll soon find out if you haven’t already wink

      cheers/k
        • 23516
        • 2 Posts
        pixilliontom Reply #3, 18 years ago
        Thanks Kongondo, that API stuff is very useful. Been looking at the Wiki a lot today and I didn’t come across that stuff. I suppose it helps when you know what to look for smiley.

        I’ve been using modX for a few months now. Don’t know anyone who has used it that doesn’t love it...I even joined the facebook group...

        I’m only just starting to dig around under the hood a bit more now so I’m sure I’ll be mining for info on a more regular basis. Still no clue on the JSON stuff, but that seems like it’ll be a tricky one.