jensimmons / thewebahead

A space for tickets about the forthcoming website for The Web Ahead.
9 stars 0 forks source link

Talk to Jen about Comments & Entities #12

Closed jensimmons closed 10 years ago

jensimmons commented 10 years ago

I've got complex ideas about how people can comment on episodes, contribute links, submit corrections, and provide other resources for learning. I don't think Drupal's basic commenting system is what's needed. I'm thinking more along the lines of letting listeners add new content to the system of a certain type (like "correction") with a need reference linking the two (the correction & the episode it belongs to).

Perhaps nodes, node reference, views with arguments, and a good architectural plan is all that's needed. Although, perhaps someone who's a master of D7 entities would say, no don't make these comment-like content objects into nodes, create a custom entity... make them like comments....

I don't have a mastery of entities. So I'm not sure what the best way to go is... plus I haven't thought all of this through — what exactly I want for functionality and user experience.

I don't want to over-engineer this. Maybe nothing custom is needed. But I don't want to hack together a pile of not-quite-right if some elegant use of custom entities would be better.

Thoughts? Let's use this thread to talk this out.

sffitzpatrick commented 10 years ago

Jen, this sounds interesting. I don't have a mastery of entities either but regardless it seems smart to separate something like a Correction from regular Comments. In my way of thinking, Corrections would be content, so I'd probably just use nodes...

Here's a possible recipe based on your initial thoughts:

  1. Create a content type (or new entity) with a node reference field and other fields you need (e.g., body and whatever else).
  2. Add a link (node links array) to each Episode node in the theme or hook_node_view, linking to /node/add/correction.
  3. Use a form alter to auto-populate (and hide from most users) the node reference field on the Correction form if the referer url is an Episode node. Or alternatively, add the referer nid as a url parameter in 2 above, as in "/node/add/correction?ref_id=XXX" and get the value that way. Possibly autopopulate and hide the Title field as well?
  4. Use views+args to display Corrections on the Episode nodes. Possibly append the view in hook_node_view from 2 above, or in theme_node or tpl or Blocks UI or wherever makes sense

Happy to help work out a prototype for this if that sounds like good approach. I should have some time tonight or tomorrow afternoon.

Sean

jensimmons commented 10 years ago

Yeah, I'm going to think about this some more. There are other priorities to tackle first — like creating the theme!

I remember doing this in D6 without custom code. Lullabot had a tutorial on building a a photo gallery with module recommendations someplace. Clickity-click. Each main node page (gallery) ended up with a link to add more images (a separate content type) to that gallery (through node reference). The two content types + node references is easy enough. The last magic piece was the link on the one node (episode in our case) that would pre-populate and hide the reference field so the person adding the content (correction) wouldn't even realize what's happening. Exactly what you are saying, only by finding that module instead of writing a new one.

I'd actually forgotten about all this until I started typing this issue up, so just explaining this to you has been helpful.

I'm thinking each episode will have several kinds of additional-associated-listener-contributed content. And yes, it's all content, so perhaps nodes do make the most sense.

These ideas are not fully fleshed out. Sorry for rambling instead of waiting until I have wireframes or something.

This is not the top priority, all this stuff. I know it's going to take a while to build, and I'd like to meanwhile ship a site for the show that has just the minimum needed to be viable. So without all this. This will come in Release 2.

So let's not write any code or build any of this. Not test it. Just think a bit and write in this rambling discussion. We can get serious about this later.

jensimmons commented 10 years ago

A, ha! Here it is: Node Reference URL. https://www.drupal.org/project/nodereference_url I'm adding it to the repo now.

jensimmons commented 10 years ago

Yes and yes. But not now. Later. Like in the Fall/Winter. So I'm going to close this for now.