We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14226
    • 8 Posts
    Hey everyone,

    So I just recently installed ModX Revolution and am in need of some help/direction. I’m experienced with PHP, HTML, CSS, etc. so that’s not the issue. I’m moreso finding myself overwhelmed by Revolution and figuring out how to code whatever it is I’m trying to do.

    The first thing I’m trying to do:
    Check if a cookie is set, if so, output some html code, otherwise don’t.
    I know how to do this without revolution..just confused how to set it up with it =)

    The second thing I’m trying to do:
    Create pages for categories of resources.. I’d like to list all of resources within a resource group (aka their title and a description of them, with a link to the resource), sorted in some particular way (most recent first works for now, though I might wanna customize it later).

    Also, I’ve looked through documentation, but haven’t found it all that helpful. If someone could share some good tutorials or how they got going it would be greatly appreciated.

    Thanks!
      • 22303 MODX Staff
      • 10,725 Posts
      Quote from: jj101 at Jan 19, 2011, 03:28 AM

      The first thing I’m trying to do:
      Check if a cookie is set, if so, output some html code, otherwise don’t.
      I know how to do this without revolution..just confused how to set it up with it =)
      Just create a snippet, check the $_COOKIE, then return a MODx chunk (using $modx->getChunk($chunk)) containing your HTML, or an empty string if the cookie is not set. Then just put the Snippet where you want the HTML to be output (or not) and make sure you call it with the non-cacheable token, e.g.
      [[!CheckMyCookie? &chunk=`nameOfChunk`]]


      Quote from: jj101 at Jan 19, 2011, 03:28 AM

      The second thing I’m trying to do:
      Create pages for categories of resources.. I’d like to list all of resources within a resource group (aka their title and a description of them, with a link to the resource), sorted in some particular way (most recent first works for now, though I might wanna customize it later).
      Check out getResources and tagLister. FWIW, resource groups are for applying security in MODX, and not for categorization.