I want to have part of my form be a CRUD for a taxonomy that will be initialised within the module. Therefore I need something similar to the taxonomy editing built-in to BD, including the drag/drop js to handle weights/parents. Is there an example of this somewhere? I have tried dissecting the taxonomy module, but it's spread over a lot of files, so was opaque. I looked at some D7 examples, but everything I tried to copy there threw weird PHP errors.

Comments

If I'm understanding  correctly, you want to provide the ability to create a Taxonomy Term. Have you looked into using Entity Connect? That's a great little module that provides CRUD capabilities within the form.

  • A few caveats: you'll need to use a Entity Reference field to reference the taxonomy term (not the core term reference field) 
  • The widget will redirect you to the core term creation/editing form, and then redirect you back to the original form. This may create some workflow issues if you are dealing with a multistep form (I think)