We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38357
    • 178 Posts
    Hello,
    I'm new to Revolution and struggling a bit.
    Could someone please direct me to a clear tutorial or set of instructions showing how to create links for users to download PDF files? I read through a forum post which talks of using Static Resources but it became very confusing and convoluted.
    Any assistance appreciated

    Thanks
      • 10208 ☆ A M B ☆
      • 1,780 Posts
      Pretty sure you can do it a number of ways.

      1-Create an absolute url
      2-Create a link to the location of your .pdf with MODX tags:
      <a href="[[++site_url]]assets/templates/yourDirectory/yourPDFfile.pdf"

      3-Create a custom setting pointing to your location and use MODX tags:
      <a href=[[++yourCustomSetting]]yourPDFfile.pdf" />

      4-Create a resource, set it for Static Resources, set the pdf file you want, and then call it with a resource ID
      [[~id]]


      I'm still a little fuzzy on calling ID's. The docs show both
      [[~id]] and [[*id]]
      which confuses me but I got it to work yesterday by using
      href="[[~40? &scheme=`full`]]"


      Look here: http://rtfm.modx.com/display/revolution20/Tag+Syntax [ed. note: frogabog last edited this post 14 years, 8 months ago.]
        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
        • 10208 ☆ A M B ☆
        • 1,780 Posts
        Quote from: frogabog at Jan 25, 2012, 12:44 PM

        4-Create a resource, set it for Static Resources, set the pdf file you want, and then call it with a resource ID
        [[~id]]




        By the way... the above idea DOES NOT work. Dangit. I just tried, a document can't be a .pdf apparently.
          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
          • 38357
          • 178 Posts
          Thanks for the response Frogabog,
          I had hoped there was a way to perhaps use getResources to create a list of PDF's for downloading.
          One of the things I am finding is that there are few good tutorials available for new users like me- or perhaps I amnot searching in the right places :-(

            • 10208 ☆ A M B ☆
            • 1,780 Posts
            Working solution:

            Create a chunk. Input your styled html with the link/image, etc. Use one of the first three options from above to code the chunk (or static resource file).

            Call the chunk from a document/page or in a TV.

            That seems to work. I can't figure out how to do it with a static resource. Maybe someone else will steer us in the right direction soon.

            I actually needed to do this with some pdf's but I wanted to do it with a TV ideally. Calling the chunk from the TV produces the same result as calling from the document or static resource file.

              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
              • 10208 ☆ A M B ☆
              • 1,780 Posts
              Haha, if I knew how to use getResources properly (at all!) I might have tried that too.

              Let me know if you come up with anything workable. I am looking to provide a TV with a few pdf options to choose from in the back end AND provide a page for visitors with a working list of downloadable pdf's like you are. I need more practice with TV's apparently.
                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
                • 38357
                • 178 Posts
                OK - thanks Frogabog.
                As you say - perhaps someone else will point to a solution for both of us smiley
                  • 32316
                  • 387 Posts
                  Try FileLister

                  Docs are here: http://rtfm.modx.com/display/ADDON/FileLister

                  It has worked well for me and was easy to set up.