Hello all,
My first post; I’m just getting my head around MODx and generally enjoying it, but I have some functionality I need to add and I’m not sure the best way to go about it -- whether I can do what I want with a snippet, plugin or module, or if the core CMF can handle it. Your suggestions would be welcome.
I am migrating an existing site to MODx. It includes some pages devoted to various products, each with a link or links to PDF downloads. The idea is to get users to register before the first download.
I had planned to do this with a weblinks and authentication ... so the product page is, say,
/products/item
and I’d create weblinks at
/product/item/brochure
/product/item/datasheet
which point to the PDF files inside /assets/docs/pdf. This all works fine (as you can see, I have suffixes set to be blank, which works well).
My plan was to set up a new web group and require authentication on the weblinks, but it turns out that’s too many hoops -- the client doesn’t want people to have to manage usernames, passwords etc. It doesn’t matter if the downloader fills out bogus details; the intent is to capture details on the way through if possible, but not to discourage downloads.
So authentication is out, and I can’t see how I could get the weblinks to return a form first if the person hasn’t shared their details yet. (Presumably a cookie would be used to see if they’ve filled out the form.)
So what’s next? Some kind of combination of eForm and a snippet? Obviously I can read cookies and redirect to the PDF, but you can’t set a cookie when you redirect, and I’m not sure how to render an eForm without losing track of the desired PDF. How would experienced MODxers solve this problem? There are about 45 different PDFs to download so the solution has to scale.
I hope the above makes sense ...
Thanks
Matt
(Enjoying MODx so far but still on the steep part of the learning curve!)
You say register before the first download - but you don’t want usernames and passwords. What do you want to happen for the second and third downloads? Register each time or use cookies or something like that?
You can use the callback functions in eform to perform actions when the user submits a form. This can be querying a custom table, etc. or redirecting to a hidden page with the link. But I guess you won’t want someone to later copy and paste the URL into their browser and bypass the form? I guess you could use the callback functions in eform to set up their session data to act just like they logged in as a specific web user that you have predefined, then redirect to a page that’s only accessible for web users.
Andy
I would think the simple way to handle this would be to put the download on a secure page that the user would register for an account to access.
"Regret for the things we did can be tempered by time; it is regret for the things we did not do that is inconsolable."
-- Sydney Harris
What about one document per PDF file? The document contains a download link. Then redirect to each document when the form is submitted.
Andy
There is a snippet for protecting downloads. I use it on one of my sites. Search for it in the resources - I can’t recall the name right now but it’s an obvious one.
Andy