We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28042 ☆ A M B ☆
    • 24,524 Posts
    ummm... not quite. You should have a different name for the array. The array is constructed "key => value". When you are assigning these, you don’t usually want the key to be a variable (I think this would fall into the area of "variable variables", which always gives me a headache), while the value often will be (for example if taken from a database). So it would be
    $myarray = array (
        'preview'  => $dbResults['preview'],
        'filetype'  => $dbResults['filetype'],
    etc.
    );

    So you would be able to say $output[’preview’] and $output[’filetype’] in order to get the values.
      Studying MODX in the desert - http://sottwell.com
      Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
      Join the Slack Community - http://modx.org
      • 7231
      • 4,205 Posts
      This may not be at all constructive so I apologize, but I don’t understand why not use Ditto and Template Variables to display the downloads. You could have this ready in relatively minutes (or at least a few hours) as well as include another level of filtering by using tags. I went through the site in the first post and there are not really that many download items, clearly less than the 5000 document modx limit. Anyway, just a thought.
        [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

        Something is happening here, but you don't know what it is.
        Do you, Mr. Jones? - [bob dylan]
        • 29703
        • 217 Posts
        I now have a working snippet thanks to NetProphet. Code is as follows:

        <?php
        $placeholders = array (
            'preview'  => $preview,
            'filetype'  => $filetype,
            'scalable'  => $scalable,
            'editabletext'  => $editabletext,
            'resolution'  => $resolution,
            'layered'  => $layered,
            'fonts'  => $fonts,
            'download'  => $download
        );
        
        return $modx->parseChunk('downloadbox', $placeholders, '[+', '+]');
        ?>