WordPress.org

Ready to get started?Download WordPress

Forums

Posts 2 Posts
IDEA: UI for creating post connections, saving connections in DB (15 posts)

  1. Adam W.
    Member
    Posted 2 years ago #

    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?

    http://wordpress.org/extend/plugins/posts-to-posts/

  2. scribu
    Member
    Plugin Author

    Posted 2 years ago #

    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.

  3. Adam W.
    Member
    Posted 2 years ago #

    Cool. I'll get to work.

  4. scribu
    Member
    Plugin Author

    Posted 2 years ago #

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

  5. Adam W.
    Member
    Posted 2 years ago #

    Yes- that was my plan.

  6. Mikkel Breum
    Member
    Posted 1 year ago #

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

  7. Adam W.
    Member
    Posted 1 year ago #

    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.

  8. enriqueleon80
    Member
    Posted 1 year ago #

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

  9. Mikkel Breum
    Member
    Posted 1 year ago #

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

  10. Adam W.
    Member
    Posted 1 year ago #

    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

  11. wp-MeMeMe
    Member
    Posted 1 year ago #

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

  12. Adam W.
    Member
    Posted 1 year ago #

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

  13. wp-MeMeMe
    Member
    Posted 1 year ago #

    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?

  14. Adam W.
    Member
    Posted 1 year ago #

    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.

  15. wp-MeMeMe
    Member
    Posted 1 year ago #

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic