Site News #11: Content gating changes, More Systems Ruby

0
37
Site News #11: Content gating changes, More Systems Ruby


Hi there graceful devs, here’s what’s new!

Content Updates

  • More Systems Ruby: I did some poking around and was reminded of some more content that belongs in the Systems Ruby course. There’s now a 7-part section on working efficiently with Ruby’s low-level file I/O APIs, using a reimplementation of the UNIX tail command as an example. I’d totally forgotten about that series, and I’m excited to highlight it in this way. Not only will you learn more about file I/O, but you’ll see an example of iteratively encapsulating procedural code into OO abstractions.

Feature Updates

New content-gating behavior

My philosophy for building Graceful.Dev is to leverage off-the-shelf code for 99% of the solution, and write the 1% of customization and glue code that makes it work “just right”. Towards that end, the site is build on a foundation of WordPress, the LearnDash Learning Management System plugin, and a symbiotic combination of WP Fusion and MemberPress for managing memberships and content access.

One area where this has fallen slightly short is in how LearnDash handles attempts to read course topics when you don’t have access (either because you’re logged-out, or because you don’t have the right course product or membership). By default, you get redirected to the course home page.

That’s not the experience I want. If someone follows a link to a Graceful.Dev topic (either from a third-party site, or from being redirected from the old RubyTapas site), I want it to behave like the RubyTapas site did: show an excerpt, and a note about how to get access (register, log in, join, etc.).

Anyway, long story short, I’ve added some customizations to the site to make it do just that: now if you don’t have access to a piece of content, you’ll see an excerpt and a notification about how to get access. This is a step toward my long-term goal of retiring content from the RubyTapas site: it enables the old episodes to redirect directly to their corresponding Graceful.Dev topics.

New Pro membership behavior

I’m still getting the hang of how to code “with the grain” of this tech stack. Originally, the way Pro membership worked was there was a group of “premium” courses that you’d get automatically enrolled in when you joined. Maintaining this course-group was a bit of a hassle, though, and a few thousand callbacks would get fired every time a new course was added to that group.

More recently, I made some changes so that Pro members could self-enroll in premium courses. This didn’t pan out as well as I’d expected, however; it confused several users and could make it look like you’d lost your course progress. It also turned out to have some hinky edge-cases, because it was effectively routing around how LearnDash normally thinks about course access.

So, after some more research, I’ve once again made a change to how Pro membership works. It now uses a built-in LearnDash feature called “auto-enrollment”. If you’re a Pro member (either directly or through a RubyTapas legacy account) you will once again be considered by the system to be enrolled in all courses. I no longer have to maintain a fixed list of “pro courses”, however. And staying “with the grain” means even less customization code to maintain.

Sorry about any confusion along the way!

That’s it for this edition. Stay graceful!

— Avdi



Source link

Leave a reply

Please enter your comment!
Please enter your name here