We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13912
    • 7 Posts
    I would like to be able to place a PDF (like a report or something) along side some copy in a document.

    I thought the simplest way would be to create a TV of ’file’ type and then stick this in a chunk on the document template, or perhaps even just a call in the document itself.

    After creating the TV, I created a new document, and uploaded a PDF file using the TV browse box, added the call and previewed.

    All that shows up is a non clickable link to the file - nothing else.

    Does anyone know a good snippet / plugin which would help me achieve this?

    Cheers,

    J
      • 1800
      • 52 Posts
      What? No replies yet!? tsk tsk..

      Well hopefully ya got it but.. what you will need to do is add this...

      <a href="[*file*]">Download File</a>


      the tv should just be a file tv like you did...  (you were just missing the <a>)

      It sorta sucks that you have to do that since if that is put into your template you always get a <a> in it..

      so make another tv that turns it on and off...
      lets just call the TV PutFile
      Input type should be "DropDown List Menu"
      the throw in this code..
      No== ||Yes==<a href="[*file*]">Download File</a>


      In your template just throw in [*PutFile*] where you want the download link to be!


      heh.. was hoping someone already made something for a pdf adder... so here one is! but it can be improved on..
        Minneapolis Web Design <-- where i work
        MODx Templates <-- new project im working on
        • 29774
        • 386 Posts
        My FileDetails snippet would do exactly what you want.

        http://modxcms.com/FileDetails-580.html

        Mark
          Snippets: GoogleMap | FileDetails | Related Plugin: SSL
          • 7231
          • 4,205 Posts
          FileDetails is a great snippet, I use it often.

          FYI - regarding the TV set to file. You need to set the out widget to hyperlynk to format the output of the TV as a link. Or do as neoneddy suggested so you can have more control. But I would use FileDetails since you get all sorts of file information (file size, icon, etc)
            [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&#39;t know what it is.
            Do you, Mr. Jones? - [bob dylan]
            • 1800
            • 52 Posts
            therebechips: ill try that out

            dev_cw: didnt know I could do that.. (btw, i am not neoneddy hes my boss wink)
              Minneapolis Web Design <-- where i work
              MODx Templates <-- new project im working on