how to create a taxonomy term creation module (maybe with CCK??) for the node/add/* forms?

Jonaboff - June 4, 2008 - 15:21

I need functionality to create hierarchical taxonomy terms from the node/add forms, because the site I am working on is to be maintained by a handful of very non-tech-savvy staff, and I'm sure the concept of creating terms before adding nodes will be lost - and categorizing after posting nodes will lead to broken pathauto paths, and this isn't desirable. I have tried CCK modules like Super Select Ultra (cck_taxonomy_ssu) but it has its limitations; what I really want is a simple text input field where a "directory path" can be inputted.

I have some PHP knowledge, and will attempt to create a module to suit my needs, but I don't really know how to start. What resources are there regarding Drupal module development? I basically want to explode the tag provided on the node page by the '/' delimiter where "term1/term2/term3" represents:

    • term1
      • term2
        • term3
  • The site is required to have hierarchical URLs and navigation - I have installed modules including Pathauto, taxonomy_list, taxonomy_context to achieve this, and everything except content creation is working fine. At the minute I have got around the problem by installing taxonomy_limit, enabling free tagging and limiting the number of terms to 1. This works fine for flat-tagging, but the required 'directory structure' isn't flat.

    The only issue I could find about this was http://drupal.org/node/19697 which is the original folksonomy module for D4.6/D4.7 and although a few people seemed keen to implement hierarchical free tagging, it was apparently never followed up. The main arguments against it there were users populating the taxonomy with hundreds of synonyms and typos, but since the site I am building will only be contributed to by staff, and as I am also hoping to use the auto-suggest that I already get on the free-tagging form, I don't see this being a big problem.

    Thanks, Jonathan

    You can download the

    keva - June 4, 2008 - 18:51

    You can download the "Creating Our First Module" chapter from Matt Butcher's new book here:
    http://drupal.org/node/260841

    sorry, I can't help with the rest of your post.

    does anyone have any similar recommendations for D5.x ?

    Jonaboff - June 4, 2008 - 22:10

    Thanks for the reply Zelavy, but I'm on D5 at the moment. I am looking around for books/online resources for module development though. Anyone have any favourites?

    Jonathan

    Drupal newbie - go easy on me ;)

    How to link from node/add/* to admin/taxonomy/*/add/term ?

    Jonaboff - June 4, 2008 - 22:17

    I have very little idea where to start with the module I described above, but I figured that if the user could open the tax admin page, say in a thickbox (or even in a new window as a last resort ;p ) then it wouldn't matter that they forgot to add the terms before going to node/add as they can be added before the form is submitted. Then maybe later, once I have the basic functionality, I could work on some javascript to auto-populate the tag field with the newly created term.

    So yeah, basically, how would I add a link to node/add/* ? Can I do this with CCK? Do I need a different module?

    EDIT: i'm going to try to do this with a block

    Jonathan

    Drupal newbie - go easy on me ;)

     
     

    Drupal is a registered trademark of Dries Buytaert.