SPLOT Fest – Story Forker using Gravity Forms

Making Alan work for his pictures

One of the things I love about my little community of people is the in-process sharing1 of work. Alan is a master of this and he puts in serious work.2 In an attempt to give a little bit of energy back I present you a very rough version of the LPC3 SPLOT Story Brancher.

To get at the roots of this idea, go read Alan’s initiating post. Alan’s making little web tools that don’t require logins and are focused on doing one small thing well (smallest possible online learning tools). Alan is capable of doing far more coding than I can so I tend to try to compensate by choosing non-programistan paths. This proof of concept took about 10 minutes this morning and probably shows that but it might inspire some deeper thoughts down the road.

This is a quick and dirty example of how Gravity Forms would enable you to-

  1. create one form that enables the duplication/forking of whatever post it is in w/o requiring user login/account or creating new forms
  2. have the option to do some sort of incremental titling
  3. trackback to the parent post automatically for some sort of x begat y begat z etc. etc. navigation

Get the Body

This is the only code-ish piece. The gist below, added to your theme’s functions.php file, takes the body of the post that the form is in and puts in the designated field through the dynamic population hook. It’s the first time I’ve ever tried this option as it had seemed fairly intimidating previously.

I just used the Post Body field and turned on the dynamic population option and then named that variable post_body.
Screen Shot 2014-12-14 at 12.27.14 PM

The Other Stuff

The title is just the name of the post and the date appended using the Default Value option and a few merge tags

{embed_post:post_title} {date_dmy}

Screen Shot 2014-12-14 at 12.29.35 PM

<div class="trackingback">
Homage to <a href="{embed_url}">my mother</a>

This little piece at the bottom of the post field just captures the URL of the source page and links it back. I wrapped it in a div so I could disappear it if I wanted to.

To Really Work

I think you’d make the duplicator/editor portion take focus and expand based on a user interaction — some sort of button like “Fork Me”. The titling should be smarter. The editor doesn’t allow for media uploads. Maybe it could just make do with a way to add URLs to images instead.

1 I initially wrote “documentation” and then changed it so I wouldn’t hate myself for making stuff sound harder than it is.

2 Even taking pictures – see evidence above

3 Least Possible Code

2 thoughts on “SPLOT Fest – Story Forker using Gravity Forms

  1. You are reaching the borders of Programmistan when you are adding code to functions.php!

    I’m pondering of breaking down the rework a whole post. What if you could fork by paragraph?

    1. Much closer to programming than I like to get but sometimes these things must be done.

      The paragraph level stuff would be interesting. I wonder what the navigation would look like.

Comments are closed.