• Resolved Meace

    (@meace)


    Hi,
    Thanks for the great plugin! I was wondering if it is possible to store multiple sets of connections values between the same type of posts.

    Something like this:

    p2p_register_connection_type( array(
        'from' => 'post',
        'to' => 'post',
        'title' => 'Group A'
    ) );
    
    p2p_register_connection_type( array(
        'from' => 'post',
        'to' => 'post',
        'title' => 'Group B'
    ) );

    And then loops through the groups separately in the single page template.

    When I try that it adds a connection to both Group A and Group B instead of only the group it was added to initially.

Viewing 1 replies (of 1 total)
  • Plugin Author scribu

    (@scribu)

    You can do this with the development version (0.8.1-alpha2):

    p2p_register_connection_type( array(
           ...
           'data' => array( 'type' => 'group_a' ),
    ) );
    
    p2p_register_connection_type( array(
           ...
           'data' => array( 'type' => 'group_b' ),
    ) );

    Then, you would query connections for a certain group like so:

    $connected_in_group = get_posts( array(
           ...
          'connected_meta' => array( 'type' => 'group_a' )
    ) );
Viewing 1 replies (of 1 total)

The topic ‘Multiple Connection Groups?’ is closed to new replies.