Should I be using a CPT or ???
-
Looking for a bit of advice on how to handle this scenario:
We run a Martial Arts school with numerous classes across the country.
One of the many tasks we are setting up through our website is the ability for students to apply for their grading.
What I have done so far is create a ‘workflow’ of sorts for the grading application process which is basically a Woocommerce item called Grading Application. Once a successful payment has been made, the user is automatically taken to the HTML form that is pre-filled with the students info and photo from their user profile (“Ultimate Member” Profile) which is then submitted to a script that generates a PDF file on a pre-designed PDF file using FPDF & FPDI. The student then downloads the PDF file and submits it to their Instructor. (I was going to incorporate a function to automatically mail the PDF to the instructor and the student, but want to see what other options I have before doing that – see the next paragraph)
What I would like to do is create a totally online system where once they have have submitted the form and the PDF file is generated, it is automatically added into the WordPress Admin area (i.e. as a Custom Post Type or ??) and the file can be accessed by the Master Instructor as required.
So when he goes to the “Grading Applications Admin area, it would display something along the lines of a table with columns such as:
Date, Student Name, Class Name, PDF Application Form (link), and maybe a grading result column (Pass/Fail), or at least an option to mark that grading applciation as completed once the Grading has been done (Ideally, the table would only show Grading Applications that are not completed).
and then possibly some actions such as print, download, etc.
Note: this doesn’t have to be in the Admin area specifically, I am happy to just have a “front end” (admin only) page for him to do these things if it is easier?
I’ve only just started working with WordPress again recently (Last time I used it was years ago when it was still only essentially a blogging platform. A lot has changed since then :)
Any and all advice is appreciated
The blog I need help with is: (visible only to logged in users)
-
Hi –
I’ll be glad to work on this with you. Please remember that the ecommerce plan on your account grants access to our live chat support team 24/7. That’s always going to be the fastest way for you to get help with such questions. Go to https://wordpress.com/help/contact/ to connect with our chat team.
Would the students submit this from behind the membership sign in?
-
Yes that’s correct. The student must be signed in as the form pulls data from their profile information in the database.
The form is then submitted to a FPDF/FPDI script which generates a PDF file incorporating the information from said form
-
Have you considered adding the PDF as a media item?
Noting too, the custom programming aspects of all this are a bit above what we typically do here in our free site forums, so you might also get some feedback from the developer forums over at https://wordpress.org/support/forums/ — even though the site is hosted here, it’s definitely along the lines of custom WordPress development.
-
Noting too, the custom programming aspects of all this are a bit above what we typically do here in our free site forums, so you might also get some feedback from the developer forums over at https://wordpress.org/support/forums/ — even though the site is hosted here, it’s definitely along the lines of custom WordPress development.
I was originally going to post over there, but was hesitant because of the “hosted on WordPress.com” rules they had
Have you considered adding the PDF as a media item?
No I hadn’t thought of that. Is that fairly simple to do from a script perspective?
And then possibly display media items in a list as I described above?
If so, is it possible to tag or assign a category to a media item programmatically? That way it would be a fairly simple process to display all media items tagged with “grading-form” or similar in some kind of list.I’m not sure if that’s where you were headed with your question? If not, please feel free to elaborate :)
As I said, I’m open to any and all ideas anyone may have. -
Is that fairly simple to do from a script perspective?
Honestly I’m not much of a developer, but I’d imagine that would be the cleaner way to go since PDFs are already uploaded as media types.
Media doesn’t get taxonomies by default, but, you could add a plugin to do that, and you might find it comes in handy with a large site anyway.
OR, you could auto generate pages (or posts) to go with the media file, and automatically add taxonomy to that.
Also, for what it’s worth, PDFs usually aren’t displayed inline, at least not automatically.
If you use the PDF block, as I have done on my own site, it can be embedded on larger screens:
https://wordpress.com/support/embedding-a-pdf-file/But I’ve noticed on small screens it just as a “Click here to download” .
So, maybe you:
– Have the person fill out the form
– Auto generate a _page_ with the proper taxonomy
– Auto generate the PDF as a media attachment for that page
– Add a PDF block with the media file URL to display the PDF on the pageIf you did that, honestly you wouldn’t even necessarily need to generate media items for each PDF, but that could come in handy for managing files later. Especially if you added taxonomy to the media type, too.
Either way, just be sure you’re doing it all with writing a plugin or a functionality scripts, though, rather than editing the code directly. That way when things update, you won’t lose your changes.
-
Hi again, sorry for the delay in replying, I’ve been rather busy with my “day job”.
Anyway, after a bit of thinking as to how I wanted to handle this, I decided to go ahead with the Custom Post Type option. I have created the Custom Post type and assigned input fields to that CPT using ACF’s.
I then modified the admin page for the CPT to display the required fields in a list format. Each Listing displays the featured image (student photo), along with their name (Post title) and a few other details. I am then hoping to display a link to the PDF file as part of that list.
Screen shot of Admin Page: https://imgur.com/tnJ1Pc1What I am hoping to achieve now is once the student completes and submits the form, it is automatically “posted” as the Custom Post Type (Grading Application) and will then be in the list for the Master Instructor to access and do what he needs to do with it.
As part of this, the PDF form would need to be attached to the post (currently there is a file attachment field using an ACF File Upload field so I can manually attach a file while I am figuring this out – ideally the PDF file would be attached to this somehow…).I guess what I am asking now is:
Once the form is completed and submitted to the FPDF script, I need some guidance on how to automatically create the custom post and attach the file to it.Thanks for any input :)
-
Hm, in this case, since the difficulties appear to stem from ACF, I recommend asking at https://www.advancedcustomfields.com/support/ so the plugin’s developers and support community can help you with this.
- The topic ‘Should I be using a CPT or ???’ is closed to new replies.