• Hi,

    First, I really love your plugin – thanks you very much for your efforts to the community !

    I have a quick question…
    Would it be possible to enhanced ‘fields’ API to insert a select box instead of the input text ? Something like that…

    register_connection_type( array(
        'from' => 'post',
        'to' => 'page',
    
        'fields' => array(
            'foo' => array(
                'title' => 'Foo',
                'type' => 'select'
            ),
            'bar' => array(
                'title' => 'Bar',
                'type' => 'date',
                'default' => 'current date'
            )
        )
    ) );

    OR…
    Would it be possible to enhanced ‘fields’ API to populate a field with a custom taxonomy to create a select box instead of the input text ? Something like that…

    For example using your movie/actor demo…
    Let’s say we had a taxonomy type called ‘roles’: leading actor, cameo, etc.

    p2p_register_connection_type( array(
    	'from' => 'actor',
    	'to' => 'movie',
    
    	'fields' => array(
                'role' => array(
                    'title' => 'Role',
                     'type' => 'select'
                     'values' => 'array('taxonomy roles');
                ),
                'date' => array(
                    'title' => 'Date',
                    'type' => 'date',
                    'default' => 'current date'
                )
    	)
    ) );

    Would this be possible ?
    Thanks you very much again !

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

    (@scribu)

    Being able to display a dropdown instead of a text field is one of the things that the fields API is meant to do, but it’s not implemented yet.

    Note that the field values are meant to go on the connection itself, not on the post it’s connected to, so I’m not sure how using taxonomy terms would fit into that.

    Thread Starter twaiiiin

    (@monsieurt)

    Thank you a lot for your answer.

    Forget about the taxonomy, i’m not sure it’s very useful. I haven’t thought enough about that. But the basic field API would offer a lot of opportunities.

    p2p_register_connection_type( array(
    	'from' => 'post',
    	'to' => 'page',
    	'fields' => array(
                'role' => array(
                    'title' => 'Role',
                     'type' => 'select'
                     'values' => 'array('array of value');
                )
    	)
    ) );

    I can’t wait to use this feature.
    Thanks you very much for your efforts !

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘[Plugin: Posts 2 Posts] fields API with select box’ is closed to new replies.