We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32645
    • 377 Posts
    I am needing some help in the best way of creating a downloads page, that is:

    1) A page that lists all downloads, under different categories
    2) Each item listed gives multiple downloads, as well as different variations.

    The structure is thusly:


    Downloads (category)
    ...Wallpaper (category)
    ......Download item (page)
    ......Download item (page)
    ...Screensavers (category)
    ......Download item (page)
    ......Download item (page)

    The problem I am facing is that each item has multiple downloadable varations.

    For example, a Wallpaper downloadable can have different sizes:

    ie:
    640x480
    800x600,
    1024x768,
    etc...

    Because the sizes can be different, and lots of them it seems silly to have tons of template variables for every eventuality.

    Q1. What is the best way to handle multiple downloadable variations for 1 file?

    Secondly, I need to structure the output so it looks like this:



    Q2: In Ditto, how do I make it output one category at a time?
      • 32645
      • 377 Posts
      I am looking for the best way to output a category and then its contents.

      IE:



      1. Category title

      1a. Contents of category

      2. Category title

      2a. Contents of category

      ... etc

      I’ve tried Ditto, but that outputs everything in date descending order. Wayfinder only outputs stuff as a menu.

      What I need is a sort of inner join to display a category at a time.

      Thanks.
        • 15677
        • 4 Posts
        Bump.

        I’d be interested if anyone has an answer to this.
          • 16194
          • 103 Posts
          Anyone? Come on, this should be possible, shouldn’t it?
            Impossible is nothing - with ModX
            • 1064
            • 2 Posts
            Hi all...

            another BUMP .

            I am also interested in an practical solution, I know there was a combination of snippets to be used with Evolution but did not find something similar for Revolution. Searches for howtos about "Download Areas" or "Repositories" combined with modx bring a lot of results but not really something useful. The Filelister package http://modxcms.com/extras/package/694 looks like something, but actually seams to have another purpose - does not fit for me. Actually I tried something based on the blog howto for revolution http://rtfm.modx.com/display/revolution20/Creating+a+Blog+in+MODx+Revolution Where a Blogtemplate after some changes is a Downloadtemplate and every file is a document at the end - could be an approach but I also think there must be something better and more comfortable. I am no php programmer more a coder patcher smiley, so no way to do it on my own.

            A good example for an download area is the extras repository on this website. For me something similar would be fantastic.

            alf
              • 14214
              • 299 Posts
              The fileDownload snippet may work. You must ensure file structure is extremely organized but the snippet does work well with templating. The directory name could easily be a TV that you dynamically pass along to the snippet - perhaps based on the doc title and match it with the name of the folder.

              With fileDownload your specified directory would need to be: directoryWhereFilesAre/Folder/NameOfWallpaper/(files named by size)

              Getting creative with the templates allow you to make it look however you would like. Additionally, you can allow users to browse certain folders. Here is an example of how I used it in my technical library: http://bit.ly/dMcDiT


              Another option, which I have not played with myself, is MaxiGallery. I know you can output lists as well as the images.
                • 16278
                • 928 Posts
                Getting back to using Ditto to list items in blocks under category headings, I’ve done this using a PHx modifier on a page listing players in a band (screenshot attached).

                The Current Players part of the page reads:
                <h3>Current Players</h3>
                <table class="players" border="0">
                <col width="180"></col><col></col>
                [!Ditto?parents=`47` &tpl=`people.player.tpl` &orderBy=`menuindex ASC` &noResults=` ` !]
                </table>
                


                The people.player.tpl chunk:
                <tr><th>[+bwPosition:repeat=`[+lastPosition+]`+]</th> <td>[+hidemenu:is=`0`:then=`<a href="[~[+id+]~]">[+pagetitle+] »»</a>`:else=`[+pagetitle+]`+]</td></tr>


                The PHx modifier phx:repeat (maybe it would be better named no_repeat wink ) compares the current value of bwPosition with the value stored in a placeholder on the last iteration:
                // phx:repeat
                if ($output == $options) {
                	$result = ' ';
                } else {
                	$result = $output;
                }
                $modx->setPlaceholder('lastPosition', $output);
                
                return $result;


                smiley KP
                  • 1064
                  • 2 Posts
                  Hi all ...

                  jisaac, for FileDownload did you mean this one http://modxcms.com/extras/package/?package=146 ?

                  It is just available for Evolution and unfortunately not for Revolution sad . If you meant something else please let me know.

                  At the weekend I will try to play around with the approach from kp52, thanks for that.


                  alf