We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 49515
    • 184 Posts
    Ok, I found out the link is from the WordPress.
    However, now I am stuck with a different upgrade MODX 2.3.3-pl, which doesn't provide an easy and familiar GUI to upload and link to a PDF document.

    I have uploaded the PDF to MODX > Files > Filesystem > Documents > file1.pdf.
    Then I go to Resources > Welcome > Template Variables > and there's only HTML. No option to click a link to add the PDF to the link.

    Any suggestions please?
      • 49515
      • 184 Posts
      I can't link the uploaded pdf into the Template Variable.
      So, now I'm looking at the Resources > Welcome > right click > Create > Document (or Static Resource).
      Not sure if these will let me put a link in for a pdf on the new MODX?
        • 49515
        • 184 Posts
        I tried coding HTML into the Template Variable href="Documents/file1.pdf"
        However, I can't confirm what the correct path is to the uploaded PDF on MODX?
          • 49529
          • 196 Posts
          You should use input type = file on this TV.
            • 49515
            • 184 Posts
            Thank you for the suggestions.
            I tried some input type code from w3schools http://www.w3schools.com/tags/att_input_type.asp:

            <h2>Header</h2>
            <p>text blah, blah, blah</p>
            <p><span style="font-size: 12px; line-height: 1.5em;">Download the file1.pdf here:</span>
            <input type="file" name="Documents/file1.pdf">
            <a style="font-size: 12px; line-height: 1.5em;" href="Documents/file1.pdf" target="_blank"></a></p>

            This HTML code asks the user to select a file for upload from their computer, but I need a link to click on to download the pdf file from the MODX website.

            Therefore, I tried this code which seems to work for now...
            <form method="get" action="Documents/file.pdf">
            <button type="submit">Download!</button>
            </form>

            Unfortunately, the Download button leaves a nasty space after the text saying, Download the file1.pdf here:
            Also it's left aligned, so I think I'll have to look up some HTML code to centre it.
            What happened to the user friendly old MODX version?

            Doesn't look very good :-( [ed. note: eiger3970 last edited this post 11 years, 8 months ago.]
              • 10208 ☆ A M B ☆
              • 1,780 Posts
              Make a new resource (page), set the content type to PDF, and make it a static resource. Set the static file to your pdf file. This is the easiest way to set a file for linking, especially if it will be changed ever or listed with other files (sibling pdf pages, pull up the list with something like getResources or even Wayfinder)

              You can use tinyMCE and insert the link to the page you just created, or do in html as
              <a href="[[~id]]" title="title of PDF" target="_blank">Title of PDF</a>

              Where "id" is the actual id of your pdf resource.

              To style the link to look like a button or to space it, etc., use CSS. In fact, all your stylings would normally be done with CSS rather than inline as shown in your code above.

              Additionally, even if you don't make it a static resource, the link to the file would simply be the path of where you uploaded it to. I'm afraid you're making this a little more work than it needs to be with the form and the download submit button. I would also suggest using your assets folder with MODX, and keeping your document folder out of the root of the site. One big advantage is keeping editors out of the root of the site where the core, manager, and components folders live. Other people simply don't need to go into that area and poke around, if you can help it. I'd suggest using assets/documents/file.pdf.

              <a href="assets/documents/file.pdf" title="title of PDF" target="_blank">Title of PDF</a>
                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
                • 49515
                • 184 Posts
                Thank you, that's quite helpful.

                1.
                I'm just wondering about storing all PDFs in Filesystem/assets/documents.
                Some files are already stored in Filesystem/Documents/assets/images.
                I think I'll make a new directory Filesystem/Documents/assets/PDFs.

                I think you're trying to say it's best to keep other people out of the root, so Filesystem/Documents/assets/PDFs should do this.
                In fact, the current location of Filesystem/Documents/PDFs is already out of the root system isn't it?

                2.
                Ok, so now I'm thinking about the new Resource Page, setting the content type to PDF.
                This kind of messes up the Resources look, where it has pages kind of like the website with tabs. E.g., Home, Contact etc.
                I don't understand the benefit of placing PDFs in the Resources/newStaticResourceContentTypeForPDFs, compared to the Files > Filesystem > Documents > assets > PDFs?
                You mention linking is easier, so I might be too much of a noob to get that yet.

                3.
                Yes, I also have no need for a download button, it's just that I couldn't make a link to click on for the PDF download?
                  • 10208 ☆ A M B ☆
                  • 1,780 Posts
                  Quote from: eiger3970 at Feb 09, 2015, 09:53 PM
                  Thank you, that's quite helpful.

                  1.
                  I'm just wondering about storing all PDFs in Filesystem/assets/documents.
                  Some files are already stored in Filesystem/Documents/assets/images.
                  I think I'll make a new directory Filesystem/Documents/assets/PDFs.

                  I think you're trying to say it's best to keep other people out of the root, so Filesystem/Documents/assets/PDFs should do this.
                  In fact, the current location of Filesystem/Documents/PDFs is already out of the root system isn't it?

                  True. I misspoke on that. You don't need the additional assets folder. It is however where other files live, such as your image files should you use the Gallery Extra. In general, you'll find you're in the assets/something folder more often than not.

                  2.
                  Ok, so now I'm thinking about the new Resource Page, setting the content type to PDF.
                  This kind of messes up the Resources look, where it has pages kind of like the website with tabs. E.g., Home, Contact etc.
                  I don't understand the benefit of placing PDFs in the Resources/newStaticResourceContentTypeForPDFs, compared to the Files > Filesystem > Documents > assets > PDFs?
                  You mention linking is easier, so I might be too much of a noob to get that yet.

                  As noted, the benefit is that it's easy to change the file if needed in the future and no one has to touch the html of the link (the editor simply changes the path, or even the file name in the resource), AND should you want to use something like Wayfinder or getResources to create links of files for download, it's easy and automated to show in something like a menu, or even just an unordered list of resources with MODX.

                    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
                    • 49515
                    • 184 Posts
                    Thank you.
                    I will come back to the PDF as a link has been made to the way I set it up.
                    I will try your better way after a few more things are fixed up from the MODX upgrade.

                    Now, the 7 webpages have a banner near the top and is consistent for 6 of the 7 pages.
                    After the MODX upgrade, the 5th webpage page shows a different banner and I can't see where MODX's Dashboard manages the banners? Any suggestions on the breadcrumb or process please?

                    I think the problem might be that the NEWS webpage runs from WordPress, so somehow the MODX upgrade messed up the WordPress page which was embedded (or something) in the MODX banner theme? [ed. note: eiger3970 last edited this post 11 years, 8 months ago.]
                      • 49515
                      • 184 Posts
                      To reply #38, the problem was a Template Variable.
                      Fixed with simple HTML editing. The template variable field box is so small that I can only read 2 lines of 15 characters wide.

                      So, now I'm back to the main issue, the 1 MODX page with WordPress text in it.
                      The page shows 6 Navbar tabs and top banner wrong text, compared to the other webpages with 7 Navbar tabls and top banner globally identical text.

                      I think the MODX upgrade somehow pulle up an old WordPress file, rather than a current WP file?