We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28033
    • 925 Posts
    I run a fan site for Namco’s "Tales of" series. I’m moving over to ModX from Etomite, for various reasons (better organization of snippets, better plug-ins, etc.).

    For pages like ones that hold items/weapons/etc., I wanted to make chunks that held each of the items, so it could be used anywhere where it is needed on the site (plus it makes it easier for our staff members to include the item/etc.).

    For instance, on a page that list the items in a shop, I would like to be able to click the name of the item, and a window pops up, with the chunk specified. I guess the call for that would be the name of the snippet, a value for the template (done on the users end), and the name of the chunk called.

    http://www.cavesofnarshe.com/ff6/enemies.php <- Click a link under the Metamorph section, and that’s essentially what I was wanting to do.

    I dunno if ModX is capable of doing that, hence why I was asking. Anyways, many thanks if someone is able to code this. smiley
      My Snippets
      -> PopUpChunk v1.0
      • 33372
      • 1,611 Posts
      If I understand what you want to do correctly, I would do it with TVs and a snippet. You could create TVs (Template Variables) that in the Manager are a list of checkboxes and your staff people could just check all the items available on that page. If you need multiple categories of checkboxes you can just create a TV for each category.

      Then you can either format the output of the TV to show the pop-up links that you want or create a simple snippet that gets your TV values and does the same thing. Either way will work (in MODx there are almost always several ways to do anything). The pop-up links in themselves are just simple JavaScript, so that’s just a matter of formatting your output the way you want it.

      Template Variables confuse some people when they’re starting out because they are capable of a great deal of advanced features, but if you start out with simple ones and search the documentation and these forums for advice you should get the hang of them very quickly.
        "Things are not what they appear to be; nor are they otherwise." - Buddha

        "Well, gee, Buddha - that wasn&#39;t very helpful..." - ZAP

        Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
        • 28215
        • 4,149 Posts
          shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
          • 28033
          • 925 Posts
          I just thought of messing around with TV’s after I posted this. XD

          Your explanation sounds like it would work. I’ll let you know how it goes. ^.^
            My Snippets
            -> PopUpChunk v1.0
            • 28033
            • 925 Posts
            Quote from: splittingred at Jan 23, 2007, 08:46 AM

            You might want to check out this article:

            http://wiki.modxcms.com/index.php?title=How_To_Create_TV-Based_Chunks

            I found on error on that page, which gives a parse error if you don’t realize it.

            foreach ($ar_chunks as &$chunk) {

            The bolded part causes the "unexpected &" parse error. It works perfectly otherwise (and I think this’ll suit what I needed. smiley
              My Snippets
              -> PopUpChunk v1.0
              • 28215
              • 4,149 Posts
              Quote from: Soshite at Jan 25, 2007, 07:46 PM

              I found on error on that page, which gives a parse error if you don’t realize it.

              foreach ($ar_chunks as &$chunk) {

              The bolded part causes the "unexpected &" parse error. It works perfectly otherwise (and I think this’ll suit what I needed. smiley

              Soshite:

              Good catch - I didn’t realize that the & in foreach iterations isn’t supported in PHP4; the code I wrote for that article is in PHP5, which runs fine. I’ve removed the reference, since it really isn’t needed there. Thanks!
                shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com