On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • Hello All,

    I have a question and I am new to MODx so here it goes. I have a site that was developed for a client. In the site there are multiple links to download PDFs (assets/downloads/pdfs) across a wide range of pages. The client wants to set it up so when a user clicks to download the PDF he/she gets a simple form with a login, password, and email. After the form is completed they will be redirected to the PDF they were going after. Or at the very least be redirected back to the page they were on and allowed to then download the file. What is the best way to go about this? I have searched around and have seen a couple answers but have not found anything definitive. I would really like to implement one login page that would work dynamically for all the PDFs in the site.

    I only want the user to have to fill out the form once, and then from there they can download as many files as they want. Any help would be greatly appreciated. THANKS!
    • I think your best bet is to make all the download links mini-forms (they don't have to look like forms). They would have a hidden field with the name of the PDF file (but not it's real path). The form's action would be the URL of a generic download page containing a snippet tag.

      The snippet would check the user's login status. If logged in and qualified, the snippet would calculate the real URL (perhaps with a secret key appended) and they'd be instantly forwarded to the true URL of the download page (maybe a static resource with a link to the PDF file).

      If they were not logged in, they'd see a login form and/or a link to a register form page.

      I don't know if you want to set a cookie to let people be permanently logged in or not.

      You might take a look at the Subscribe extra. I'm not sure if it would meet your needs or not.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
      • Добрый день!
        Помогите мне пожалуйста.Я зашел в админку сайта,решил добавить новость,после того как я попытался изменить новость на главной странице у меня исчез профиль (то есть картинка)остались только надписи.Как мне сделать все обратно huh
        • You would do better to either

          1. Post your questions in English

          2. Post in the Russian-language section of the forums - look in "MODx Around the World".
            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
          • Good day!
            Help me I am went to the admin site, I decided to add news, once changed the news (news and on the main page ) design of the site disappeared . Clicking on contacts or tariffs site works normally , and the homepage and news no . If you do not understand what is the problem (and probably not really clear , it's hard to describe the problem in words ) , I urge you to check out my site and understand everything . I hope for Your help . Previously, many thanks to You . http://www.vashe-taksi.ru/
            • valeras10, your pages are missing the head section, so there is no css file...
              Check your templates.
              • hello to all,

                iam rajneesh tripathi. newbie here from india
                • Hello,
                  My ongoing issue is my Wordpress websites are unable to connect to the FTP server.
                  Getting this error:- ftp.###.co.nz:21 when trying to connect to FTP.


                  Thanks in advance,
                  Tyler [ed. note: markh last edited this post 5 years, 5 months ago.]
                  • Double check your ftp details with your hosting people or in your control panel if you have one with them and try again.

                    If you still have problems:
                    Can you elaborate I bit more on the error message?
                    What ftp client are you using or are you trying this from Wordpress backend? [ed. note: MorneB last edited this post 5 years, 6 months ago.]
                    • Hi...I'm new to MODx. Can modx work with costume APIs. For example...member login from a API. If so can you please direct me to a article or tutorial were I can read about it.