Skip Navigation

[Resolved] Membership site – with downloadable pdf's

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Our next available supporter will start replying to tickets in about 7.39 hours from now. Thank you for your understanding.

This topic contains 3 replies, has 2 voices.

Last updated by Jamal 1 month, 1 week ago.

Assigned support staff: Jamal.

Author
Posts
#1818151

I currently have a membership site using Toolset Views and Types at hidden link to serve up mathematical journal pdf articles to registered users. It uses the Download Monitor plugin to control access to the article pdf files.

I want to switch the site to the GeneratePress theme since I recently discovered some incompatibility to the current theme I use. I also want to:
- start using the Toolset Access plugin to replace my current use of the Restrict Content Pro plugin

Q: Could I only use the Toolset Access plugin to control access to the journal article pdf files to signed on users? I would prefer not to also have to use the Download Monitor plugin to handle the pdf access, if possible.

Any tips you have for the re-design of the site would be helpful. I am aware of these two areas on the toolset site:
https://toolset.com/course/wordpress-membership-sites/

and this support question here (which in 2017 recommends the Download Manager plugin):
https://toolset.com/forums/topic/access-for-pdfs/

but if you have any further suggestions which might help me redesign this membership site to reduce the number of plugins it relies on besides Toolset I would appreciate it.

I was thinking of this approach:
- rather than use the Download Monitor plugin to store and control the pdf, I would add a custom file field in my current custom post 'article' using Types and then control display of the url to that file using Toolset Access. While I would not be able to track the number of downloads (not sure how that would be possible like in Download Monitor), it would at least only display the file link to signed on users?

Another problem in my site conversion would be adding the historical data of existing pdf files to my custom post 'article'. (I have about 1200 articles!). Currently in the Types custom post 'article', there is a custom field with a download monitor 'shortcode' (eg. [id='1234'] etc) which points the Download Monitor plugin to the correct pdf in the Download Monitor custom post type 'downloads'. The custom field 'shortcode' essentially links my Toolset Types custom post 'article' with the correct download in the Download Monitor plugin custom post 'downloads'. I do not understand how to merge the current 'article' post type data (which contains custom fields like author and title), with the pdf url data in the 'downloads' custom post (which also contains the custom field '# of downloads')?

Many thanks.

#1822387

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello and thank you for contacting the Toolset support.

My apologies for the late reply, but I do not work on Wednesdays and Thursdays.

You can use the Toolset Access plugin to restrict access to the custom post type Article, or its custom fields. But, you won't be able to restrict download. If a user that has access to the download link shared it with non-members users, they will be able to download the pdf file.
If you need to restrict the download of files to only members, you will need to use a specialized plugin such as Download Monitor.

Regarding your last question on how to merge the data between your articles and their related files, I'll need more details about the setup to better answer you.
- I understood that Article CPT holds some custom fields, but what information you need to pull from the downloadable files?
- Is the downloadable files stored as custom post type? What custom post type?
- Are you setting any relationship(Toolset relationship) between Article CPT and the downloadable files?

#1823357

Thank you Jamal.

"If you need to restrict the download of files to only members, you will need to use a specialized plugin such as Download Monitor."

I will be happy to just hide the link from non-members (I'm dealing with mathematicians...). However, I will have to export the data from the current Download Monitor (DM) custom post 'Downloads' (with fields: download id, file url, and # of downloads) because it is in a DM CPT and unaccessible at the moment.

" I understood that Article CPT holds some custom fields, but what information you need to pull from the downloadable files?."

I need the DM fields: download id, file url, and # of downloads

Is the downloadable files stored as custom post type? What custom post type?

The DM plugin creates a CPT called 'Downloads' with the above fields

Are you setting any relationship(Toolset relationship) between Article CPT and the downloadable files?

I was considering two possible approaches:

a) merge the exported xml download files data using the plugin CSV Importer which will use the key field 'download id' (which is both in my Types 'article' CPT and in the export data from DM CPT 'Downloads') to merge the DM fields with my existing Types 'article' fields --> The result would be all the article and file data would be contained in only one CPT

Or

b) utilize the relationship power of Toolset Types and create a 2nd CPT, 'articledownload' with the DM fields (fields: download id, file url, and # of downloads). I would then not require the expensive CSV Importer plugin and could import the data using phpmyadmin. Then use a Types post relationship 1-to-1 to link the 'download id' which would be a key field present in both 'article' and 'articledownload'?

Which approach do you think would be better?

#1823373

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Thank you for your feedback.

If you would only hide the URL for non-members, you can use conditional shortcodes if you are building views with the legacy editor or a conditional block if you are using the block editor.
Check this previous ticket for the legacy editor https://toolset.com/forums/topic/logged-in-conditional-statement-not-working/
And this article for the blocks editor https://toolset.com/course-lesson/using-toolset-conditional-block/
Note that you can use the same condition expression for both the legacy and blocks editors.

You can find the DM fields in Toolset->Custom fields, "Post Field Control" at the bottom of the page.

If the DM fields start with an underscore(_), you can make Toolset use them by going to Toolset->Settings->Front-end Content->Hidden fields.

Regarding how you would merge the data, I would suggest, that you deactivate the DM plugin and create a new Custom Post Type with the same slug as the DM CPT. This way you can manage the same posts with Toolset without having to export or import it.
I'll also suggest using a relationship. But, if you decide to export the data and import it directly to the article CPT, that will save some kb in the database and some CPU usage while looking for related downloadable files.

I hope this makes sense. Let me know if you have any questions.