We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9849
    • 74 Posts
    Hi everybody!

    How can one get @-bindings to work in Revolution 2.0.0 alpha-3?
    In 0.9.6 i was able to use the following Input Option Values to output a list of documents:
    @SELECT pagetitle FROM modx_site_content WHERE parent = 5


    In Revolution this just gives me an "Object". Any Ideas?
    Do I have to use @EVAL and the new xPDO way? If so, how is it done?

    Greets!
    • That’s probably an oversight, and just needs to return the value differently? I’m not sure, but we’ll get it worked out; I’ve just never been a fan of using the @BINDINGs myself. With the new parser features, it seems redundant to me, but others disagree. Regardless, let me figure out what you are expecting as the result: an array of the results or a MySQL result set...
        • 9849
        • 74 Posts
        Should be an array I think. In 0.9.6 this tiny little command combined with Input Type DropDown List returned a list of document names in a specific folder (in this example "5").

        I used it for a module manager that allowed me to specify which module (documents in a parent folder) should be activated on whatever site. Its just a basic copy of a common CMS module concept I think.
          • 9849
          • 74 Posts
          No answers yet? *sigh*
            • 22934
            • 13 Posts
            Hi florian.l,

            Im having trouble with this as well! Ive tried fixing it myself but cant seem to get anywhere! sad I also just want a drop down list of documents for the user to select from.

            Paul
              • 28215
              • 4,149 Posts
              If you’re having issues, please check out the latest SVN - i know we’ve fixed some of the @ binding issues there.

              And, you can file a JIRA ticket to make sure we’re aware of this bug and can put our attention to it.

              Please remember Revolution is still in alpha and will definitely have bugs. We welcome (and want!) bug reports, and will get to them as soon as we can.

              Thanks,
              Shaun
              MODx Core Development Team
                shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
                • 22934
                • 13 Posts
                Thanks Shaun,

                Ill have a look at the SVN version.

                florian.l,

                As a temporary? solution the code below works (from stevs - http://modxcms.com/forums/index.php/topic,26826.0.html):
                @eval global $modx; $childArr = $modx->getDocumentChildren(1); foreach($childArr as $child){$opArr[]=$child['pagetitle']."==".$child['id'];} return $opArr;


                Just replace the 1 the the parent of the children you wish to list
                  • 9849
                  • 74 Posts
                  @pdiki: Thank you!