Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#508 closed enhancement (fixed)

Display links to slides and WPTV video in Session shortcode

Reported by: iandunn's profile iandunn Owned by: iandunn's profile iandunn
Milestone: Priority: normal
Component: WordCamp Site & Plugins Keywords: good-first-bug has-patch


Displaying links to each session's slides and video in the [session] shortcode output would provide an easy way for WordCamps to organize all the relevant session data and present it to users in a centralized location.

Once the data has been entered, users could visit a page like to get everything related to each session. If slides are entered before the event, users can access the page during sessions if they want to follow along with the presenter. They could also visit it after the event to watch the videos of sessions they missed.

  1. Add meta field to the Session post type to collect the URL for a session's slides (preferably uploaded to the corresponding site for archiving, but could potentially be anywhere)
  2. Add meta field to the Session post type to collect the URL for the video of the presentation on
  3. Display those links when generating the output for the [sessions] shortcode, if they've been entered.

Attachments (1)

508.diff (7.8 KB) - added by BrashRebel 10 years ago.
Patch with modifications to wc-post-types.php plugin.

Download all attachments as: .zip

Change History (16)

This ticket was mentioned in IRC in #wordpress-meta by sams. View the logs.

10 years ago

#2 @BrashRebel
10 years ago

I would be interested in participating in this effort if it is still needed.

This ticket was mentioned in Slack in #community by brashrebel. View the logs.

10 years ago

#4 @BrashRebel
10 years ago

Just looking to see if I may be on the right track here as there are multiple ways to tackle this. My current approach has been to add the new fields to the Session Info meta box like so:

I could instead create an additional meta box which would contain these new fields. Not sure whether that would add any value.

Regarding the [session] shortcode, my first inclination would be to add something like this to the output:

I'm not certain these are the optimal solutions but they will work. I have other ideas for making it easier to use that I may explore. Thanks in advance for any input.

#5 @iandunn
10 years ago

That looks great, it's exactly what I was envisioning. If you have an idea for something even better, though, describe it here and we can discuss doing that instead.

The only tweaks I'd suggest to your current approach would be to:

  1. Change Video URL to WordPress.TV URL, and also to check that the URL submitted is actually on WPTV. It's fine if people want to post their videos to YouTube, etc in addition to WPTV, but WPTV should be the canonical source for all WordCamp sessions.
  2. Make the Session Info metabox appear under the editor instead of in the sidebar, so that the full URLs are visible

10 years ago

Patch with modifications to wc-post-types.php plugin.

#6 @BrashRebel
10 years ago

  • Keywords dev-feedback has-patch added

Just added 508.diff which is my first patch submission and I'm not sure I got it right. Should contain all of my changes which include:

  • Added slides and video URL fields to the session info meta box
  • Moved the session info box below the editor
  • Don't save the video URL unless it is from
  • Added links to the video and slides URLs to the shortcode
  • Added show_links to the shortcode $atts and set default to true

That should be about it. Obviously very open to feedback.

Regarding other ideas, I was toying with the thought of changing the video URL field to a <select> field instead of an <input type="text"> and populating the <option> values with a fetch_feed() call to which supplies the year and city to dynamically pull a list of the videos from the appropriate camp if they exist. Might be trickier than it is worth as I'd imagine I would have to parse the get_bloginfo( 'name' ) or something to get the location and stuff like that but it sounded fun to me.

It also occurred to me that if we stored the slides URL in its own field on instead of just throwing it in the excerpt, we could potentially retrieve that in the same call we make for the video link to avoid double entry and make this process much easier. WordCamp content moderators could then potentially just edit each session and select the appropriate video (or enter in the URL if selecting would not be feasible) and the video and slides could both be brought in automatically. Although, as you described initially, we should allow for slides to be entered long before the video makes it to Just ideas I guess.

#7 @BrashRebel
10 years ago

  • Cc kyle@… added

#8 @iandunn
9 years ago

  • Keywords dev-feedback removed
  • Owner set to iandunn
  • Status changed from new to accepted

Hey, sorry for the long wait, but this looks really good.

The only question I have is about the new show_links parameter; I wonder if it's actually necessary. If an organizer didn't want to show the links, then they could just not enter the URLs into the session posts, right?

Is there a use case where they'd want to have the URLs saved, but not display them?

#9 @BrashRebel
9 years ago

Yeah, it probably isn't really necessary. Not sure if I had a use case in mind when I made that but can't think of a need now.

#10 @iandunn
9 years ago

Cool, I'll go ahead and leave that out; we can always add it in later if we discover a need for it.

#11 @iandunn
9 years ago

It looks like 508.diff has each commit separated, which doesn't work well because the patch command will overwrite the .rej files for each commit.

Do you remember what kind of Git workflow you were using? Maybe it was created with git format-patch? I tried applying it with git apply too, but that didn't work. I was able to get it working by manually separating it into 3 files and using patch on each.

I think git diff master --no-prefix should generate a patch that's more compatible with SVN.

#12 @BrashRebel
9 years ago

Gosh, yeah I really need to learn to get that right. Sorry.

#13 @iandunn
9 years ago

No worries, I haven't tried applying Git patches to SVN before, so it's new to me too :)

#14 @iandunn
9 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 1573:

WordCamp Post Types: Collect and display URLs for session slides and videos.

Fixes #508
Props BrashRebel

This ticket was mentioned in Slack in #outreach by iandunn. View the logs.

9 years ago

Note: See TracTickets for help on using tickets.