• If I understand correctly, registration of connection-types for a site has to be done in code (a custom plugin or the theme’s functions.php) and there is also no Admin interface for creating connection types.

    My idea:
    -Register a Post Type of “Connection Type”
    -To create a new connection type, user would create a new post of type “Connection Type”
    -Provide meta-data UI fields for the admin to select/enter/edit relevant information (all the available elements of the register_connection_type function). The user could also use standard post fields (Content, Excerpts, etc) as well as taxonomies for the purposes of additional documentation.
    -Add a function to run at INIT that grabs all the Connection Types and loops through them, spitting out a register_connection_type foreach one.

    That’s the basic idea.

    Questions:

    1. Is anyone else already working on something like this? (So I don’t duplicate effort)

    2. Would anyone besides me find this helpful?

    3. Is storing Connection Type information in this manner a terrible idea?

    https://www.ads-software.com/extend/plugins/posts-to-posts/

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author scribu

    (@scribu)

    1. Is anyone else already working on something like this?

    I don’t think so.

    2. Would anyone besides me find this helpful?

    I’m sure many users would be more comfortable using a UI rather than PHP code.

    3. Is storing Connection Type information in this manner a terrible idea?

    No, it’s actually rather elegant; having a custom field for each key in the p2p_register_connection_type() array is the way to go.

    I do think that having a taxonomy registered for this custom post type is overkill.

    Thread Starter Adam W.

    (@adam-w)

    Cool. I’ll get to work.

    Plugin Author scribu

    (@scribu)

    By the way, I think it would be best if you implement this as a separate plugin, requiring that the P2P plugin be active.

    Thread Starter Adam W.

    (@adam-w)

    Yes- that was my plan.

    @adam I’m very interested in this. Are you still working on the p2p UI or what’s the status of your project?

    Thread Starter Adam W.

    (@adam-w)

    I haven’t worked on it in a while.
    Shortly after coming up with the idea, I threw together a rather hacky implementation. It’s a little ugly, but it totally works.

    I’ve been meaning to come back around to it- and your interest is just the motivation I need. Give me a day and I’ll at least publish my hacky version to GitHub and post a link here.

    This would be great, I’m sure the plugin would get much more use if a UI existed for it.

    Cool Adam, looking forward to it. What’s your github page?

    Thread Starter Adam W.

    (@adam-w)

    Please note, this is my first attempt at writing a plugin.
    It’s a little messy, a little tacky.

    But, essentially, it works.

    https://github.com/adammichaelwood/p2p_ui

    I’m not familiar with github. To use this, do I just download the php file and drop it in my plugins folder?

    Thread Starter Adam W.

    (@adam-w)

    Click the ZIP button to DL as a zip file. Then go to your plugins page and upload the zip file there. Should work.

    Thanks! I’ve done a quick test and it does appear to work, very simple and straight forward.

    Does it allow any configuration other than giving each connection a name, and from and to?

    Thread Starter Adam W.

    (@adam-w)

    Not currently, although the beginning of implementing that is sketched out (and commented out) in the code. Someone with a couple hours to kill and slightly more WP experience could probably flesh it out. The connection-attributes need to be mapped to post custom attributes. Not tough.

    If I remember correctly from 8 months ago, I got slightly hung-up on an issue of managing attributes which could have multiple definitions vs. attributes that could only have one.

    Thanks, it does work pretty well. It could do with some more config options, but for a quick setup it’s brilliant.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘[Plugin: Posts 2 Posts] IDEA: UI for creating post connections, saving connections in DB’ is closed to new replies.