Created
July 13, 2011 00:14
-
-
Save dpi/1079482 to your computer and use it in GitHub Desktop.
Drupal Relation/References Widgets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<letharion> chx: Do you already have any thoughts on whether and how to provide a references-style field widget for nodes? | |
<chx> letharion: no | |
<chx> letharion: we will reuse the references widgets instead. | |
<letharion> chx: Great. Have you talked to the maintainers? Do we intend to copy their widgets into the relation codebase? | |
<chx> copy? | |
<chx> heaven forbid | |
<chx> this is field API | |
<chx> we just need to make a field type | |
<chx> and then alter widget info to get em in the house. | |
<letharion> chx: I'm not sure I follow, will references then depend on relation? | |
<chx> if you install references then we will reuse 'em widgets | |
<letharion> chx: Ok, so the widgets will not reside in the relation module. So what I could do to advance this, is to patch references to use relation as a backend? | |
<chx> letharion: if you want to enhance this..... | |
<chx> letharion: you need to write two field types based on relation | |
<chx> letharion: one, a directional field where r_index 1 is node:* | |
<chx> letharion: and then you need to implement hook_field_load, hook_field_update (will be interesting), hook_field_insert | |
<chx> letharion: and finally hook_field_widget_alter | |
<chx> letharion: makes sense? | |
<letharion> chx: Yes, I think so :) | |
<chx> oh and hook_field_storage_pre_insert | |
<chx> which unlike the above is a real hook | |
<chx> but therein you can set up fields to be skipped | |
<chx> which you need to | |
<chx> same field_storage_pre_update | |
<letharion> I have implemented a field previously, but I don't know what all those hooks do. I will read about them and see if I have further questions. | |
<chx> letharion: but first, i do not see Rules committed. | |
<chx> letharion: this combination will hopefully let you take over from the default storage |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Related: [http://drupal.org/node/1175386](Provide widgets for specific entity types)