Plugin Author
scribu
(@scribu)
Could you provide an example of such a custom text?
I want to add an help text for exemple: informations to complete the custom input in the connection box, the right way…
Hi,
I tried to extend the P2P_Box_Multiple class with a custom My_P2P_Box_Multiple to change the template of the connection and add a text help. I tried to register my connection type with the following code but it’s not working.
p2p_register_connection_type( array(
'from' => 'post',
'to' => 'page',
'box' => 'My_P2P_Box_Multiple',
) );
Plugin Author
scribu
(@scribu)
It would be helpful if you also posted your class code (use pastebin.com if it’s long).
Also:
What version of the plugin are you using?
Do you get an error message or is the default box used?
I’m using the version 0.8-alpha.
I’ve used this topic to extend the class add add items to the connection box :
http://ww.wp.xz.cn/support/topic/plugin-posts-2-posts-how-to-add-info-to-connection/page/2?replies=78
I don’t have any error messages, but my custom box does not appear either.
Plugin Author
scribu
(@scribu)
That topic is outdated. Make sure you’re overwriting the correct method.
And again, please post the code.
I’m not really sure how to overwriting the correct method and the mustache render.
I’ll try. Thank you for your support.
I DID IT !
I registered a connection like that :
p2p_register_connection_type( array(
'from' => 'post',
'to' => 'page',
'box' => 'My_custom_P2P_Box_Multiple',
) );
And I extended the P2P_Box_Multiple Class like that :
http://pastebin.com/ufkWvQq7
And it works… But I could customize more correctly the class with the function box().
Do you have some advices to do it ? How does the “new” version (the Git version) works with mustache render ? (Can you write un wiki doc for this ?)
Plugin Author
scribu
(@scribu)
But I could customize more correctly the class with the function box().
I don’t understand.
How does the “new” version (the Git version) works with mustache render ?
I will write an up-to-date tutorial when I get the chance.
Currently, I have to copy/paste the entire function box() to customize its display.
Is it a way to do this with fewer lines of code maybe ?