We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7455
    • 2,204 Posts
    Is it posible to make the @SELECT more flexible? i like to set the id to the id from the page, I tryed this:

    @SELECT filename FROM modx_maxigallery WHERE gal_id=[*id*] AND hoofdplaatje=1
    

    and this:
    @SELECT filename FROM modx_maxigallery WHERE gal_id={$modx->documentIdentifier} AND hoofdplaatje=1
    

    and this:

    @EVAL $id=$modx->documentIdentifier;
    @SELECT filename FROM modx_maxigallery WHERE gal_id=$id AND hoofdplaatje=1
    <br /><br />but that all dit not work<br />any one knows a way to do this?<br /><br />I can not use a snippet bcause I use this tv for ditto also.
      follow me on twitter: @dimmy01
      • 22303 MODX Staff
      • 10,725 Posts
      Quote from: Dimmy at Feb 12, 2007, 09:57 AM

      I can not use a snippet bcause I use this tv for ditto also.
      No, it’s not possible, though you could try setting placeholders with another snippet first, outside the TV. Only placeholder content gets replaced in the @SELECT.

      Now, what is this last statement regarding? How does using @SELECT work but a snippet doesn’t; and what does that have to do with Ditto?
        • 7455
        • 2,204 Posts
        Quote from: OpenGeek at Feb 12, 2007, 10:43 AM

        Quote from: Dimmy at Feb 12, 2007, 09:57 AM

        I can not use a snippet bcause I use this tv for ditto also.
        No, it’s not possible, though you could try setting placeholders with another snippet first, outside the TV.  Only placeholder content gets replaced in the @SELECT.

        Now, what is this last statement regarding?  How does using @SELECT work but a snippet doesn’t; and what does that have to do with Ditto?

        Whel if I would use the tv for that page only then I could use a snippet to grab the image from the db but in this case this tv is only used for ditto. and ditto does not like nested snippetcalls in the ditto tpl.

        http://modxcms.com/forums/index.php/topic,12000.msg80137.html#msg80137

        with @bindings it would work I made the @select static and Ditto grabs the output verry nice. but a snippet did not work.
          follow me on twitter: @dimmy01
          • 7455
          • 2,204 Posts
          Man I feel stupid. made a stupit typo in the snippet I made man.. ok it works now. the snippet version.

          OK another lesson learnd but it was nice to play around a bit with the @BINDINGS.

          Greets Dimmy
            follow me on twitter: @dimmy01