We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42393
    • 143 Posts
    I have a hard-coded software products download page. It's fine for my modest needs but I don't like to hard-code anything where the data fits a regular pattern.

    Each new download has fields like this:
    - Product Name (from a tiny list)
    - Version#
    - Link to download file
    - Link to README
    - Release Date

    I'd like to create a resource accessible to Managers/myself-only, accepting the above data and storing it somewhere. Then on another resource accessible to users in various groups, want to loop through the list of available items for a given Product Name (ID) and display them with row-level formatting.

    I'm aware of FormIt but haven't used it yet. Is this the recommended tool for this, or is there another?

    If I want to modify data, can I enter an ID to populate my entry form, then re-submit?

    I can do all of this outside of the environment or with standard coding techniques. I'm just wondering if there is something convenient that's built-in to the environment.

    Thanks!

    This question has been answered by sottwell. See the first response.

      Loved ModX when I was using it a few years ago. Shifted to WordPress, sorry. Thanks, all.
    • discuss.answer
      I'm doing exactly the same thing, using MIGXdb and static resources.

      http://rtfm.modx.com/display/ADDON/MIGXdb
      http://rtfm.modx.com/display/revolution20/Static+Resource

        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
        • 42393
        • 143 Posts
        I'm on it. Thanks!

        "teach a man to fish..."
          Loved ModX when I was using it a few years ago. Shifted to WordPress, sorry. Thanks, all.
        • This project I'm working on is a big deal, so I'm going to start in nagging at the core team to do something about the problem of static resources not recognizing media sources.

          My Holy Grail is to have product support documentation .pdfs, .docs, etc. maintained in one location (at the moment, they're scattered across several different directories on at least three separate servers) and a custom media source to access them. This should make the document writers happy as well as those responsible for linking to them from the various corporate websites.

          A resource will be created for each new product, and all of its associated files, images, etc will be managed by a couple of MIGx and/or MIGXdb TVs.

          One major advantage to using static resources is that the static resource has all of the attributes of an ordinary resource, including titles and introtext, which will make search for these .pdf files and others far more effective.

          Another big advantage is that links to these static .pdf type resources will show the URL for the resource, not the path to the file, while at the same time opening up the usual download dialog (or pdf reader, however your browser is set up to deal with such things) instead of redirecting to another page. You can have these files stored outside the web root without needing a file system link on the server, so they will be completely secure from unauthorized access.

          The trick here is to create your own custom Content Types (in the System menu), then assign the static resource the appropriate type, and make its content disposition "attachment" instead of inline.

          For example, a new PDF content type would have name of PDF, a mime type of application/pdf, a filetype of .pdf, and be set to "binary".

          Now when MODx sends the page to the server, it has the proper headings to explicitly tell the browser that this is a .pdf file, so the browser can deal with it however you've configured your browser to work.
            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
            • 42393
            • 143 Posts
            I wasn't sure at first where you were going with that but now I get it. Yes, where you are talking about PDFs we have zips, PDFs, txt files, XLS and other files for download. I was just going to create a physical link to these files, and probably will in a v1.0 effort. From there, yes it would be better to have resources linking to them. One reason for this is that I need to put some files behind a user/password. Linking to physical files requires OS-level settings. Static resources are controlled by MODx permissions and much easier to manage.

            So it looks like I need to learn MIGXdb to create a basic table for the data and use "whatever" (Ditto?) to render a table of specific data items. Then use static resources so that when someone clicks a link in the rendered table of products, they can't pass that link to some other user to get the file.

            Unless someone makes another suggestion, that's my plan so far.

            BTW, Sue - for "extra credit", you might consider code which gets metadata from specific content types like PDF and XLS, then populate resource values with that data, rather than requiring someone to enter it manually. It could be possible to eliminate the manual process of generating static resources by using a cron job that looks for new content that needs to be added into the system.
              Loved ModX when I was using it a few years ago. Shifted to WordPress, sorry. Thanks, all.
            • There's an Extra for password protecting resources.

              http://modx.com/extras/package/pagelocker

              There are also a few file download packages that you can look at for rendering your static files/resources. Use chunks to render the files in any way that you wish.
                Frogabog- MODX Websites in Portland Oregon
                "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
                Having server issues? These guys have MODX Hosting perfected - SkyToaster