As far as I can see the standard method is to:-

- select a node content-type to create (from typically a small list)

- During that, from within a smallish category window try and select from a large heirarchical Category

For end-user friendliness and ease of selection it would often be preferable to browse the taxonomy category in the main window. And then when at the required term/subject be able to simple create a node there. i.e. for the node to be automatically tagged based on the taxonomy term that you have browsed to.

How can I impliment this? Or am I missing the obvious? I need this for both the sites I have created so far.

It must be a common request - to create nodes in a pre-selected term, and probably been answered elsewhere, but I have been unable to find a narrow search term to locate it with.

Regards

John Bryan

Comments

StevenSokulski’s picture

If I'm understanding this would offer functionality similar to Yahoo! and other listing type websites in which you find the category you want to post a notice in ( Las Vegas > Automobiles > Trucks ) and click an "Add Bulletin Here" link to be taken to a page with no taxonomy fields, just the Title, Body and whatever other fields you as an admin wish for them to fill out.

Sounds like a great functionality, though I'm unsure if its available. Anybody know of what might be able to do this?

John Bryan’s picture

Rather like creating these comments or a replying to a forum post

Regards

John Bryan

John Bryan’s picture

See "Is it possible to create an "Add new content in this category" feature?" (http://drupal.org/node/59865)

I am wondering whether a block could use a bit of PHP code to strip the taxonomy id (if it exists) from the current URL e.g. "http://www.lace.me.uk/taxonomy/term/5/9" and pass a taxonomy parameter "5" via/after the URL used to create the node e.g. "http://www.lace.me.uk/node/add/<content-type>/taxonomy=5" and generate a "Create node here" link.

By the way: What is the "/9" for in the taxonomy URL. It is not the term ID and seems consistent between terms?

Regards

John Bryan

adminfor@inforo.com.ar’s picture

also I don't understand the meaning of the "/9". I have this release version = "5.x-2.2"

It makes trouble with the pathauto because /taxonomy/term/xxx has alias and /taxonomy/term/xxx/9 not. Also it will cause different urls with identical content.

I removed the "/9" in the module (3 times in the code) and all url were translated to its alias as expected.

I think the module could be patched with this change if there is no strong reason to keep the "/9"

this is the url I've patched http://www.inforo.com.ar/taxonomy_dhtml

Gustavo

John Bryan’s picture

To compare with similar every day functionality...

When you reply to a threaded forum posting, you don't create the post and then have to select which forum and which posting that yours is a reply to. It justs adds your post to the posting that you were viewing.

or

If creating a document on your computer you can select MS-Word(content-type) and then choose where(taxonomy-term) to save it. OR you can browse to the folder(taxonomy-term) that you want to work in and then select the document type(content-type) to create. (trying to achieve the later)

I want my users to be able to browse to a subject (Taxonomy-term) e.g. "Home » Cancers » by Body Location » NECK/THROAT » Parathyroid", view the content(nodes) and simply add a story to that term. When initially reading about taxonomy I thought that this was going to be one of the main benefits, but it appears not 8¬(. If not easily achievable then this seems a killer failing for user-friendly interactive sites suitable for little old ladies, visually impared or just not very computer literate etc.

Site above example is based on is "Life After Cancer For Everyone" (http://www.lace.me.uk/taxonomy_dhtml)

I have found this
howto pass default values to new node form? (http://drupal.org/node/40385)

Regards

John Bryan

csc4’s picture

Generalising the forum ability to add to the current taxonomy sounds really useful in many situations

jadams1-1’s picture

I am interested in this too. The current method is very difficult for end users when using large taxonomies. Is it possible to duplicate this functionality from the forum module which already does this?

John

John Bryan’s picture

I'll let you know the result next time I get a chance to play as I think this can be made to happen with just a tiny bit of code. But I have to concentrate on fee earning work and tax returns for a few days 8¬(

Regards

John Bryan
www.ALT2.com
Application Integration Specialists
Tel: UK 08700 3456-31

H3rnand3z’s picture

subscribing

John Bryan’s picture

Create a block "Create HERE" (for example) and place this code inside it:-

<?php
$CHfilter = "tax";  // e.g. only display for paths starting with "tax" such as /taxonomy/ 
$i = 0;

// get last path argument and store in $termid
while (arg($i) <> ""):  
 $termid = arg($i);
//  print $termid."<br />";    un-comment to see list of arguments received for this page 
  $i++;
  if ($i >= 20) $i = 0;     // avoid infite loops
endwhile;

// restrict output to relevant screens
if (substr(arg(0), 0, strlen($CHfilter)) == $CHfilter) {    

// restrict output to when the last ARG is numeric i.e. likely to be a taxonomy term
  if (is_numeric($termid)) {

// fetch term data, especially the vocabulary id
    $termdata = db_query("SELECT term_data.name, term_data.vid FROM term_data WHERE term_data.tid=$termid");

// create link to autopopulate taxonomy using PREPOPULATE module compatible URL
    while ($term = db_fetch_object($termdata)) {
        print '<a href="/node/add/page?edit[taxonomy]['.$term->vid.']='.$termid.'" > Create Page in "'.$term->name.'"</a>';
      }
  }
}
?>

REQUIRES: PREPOPULATE

Error/logic checking and validation is limited, but I thought that some would like just the relatively core code.

I will use this as a basis for my first module contribution, but that will not be for a few weeks.

Known limitations

Works with sub-menu entries of "taxonomy_menu" but not with root menu entries. This is because the numeric argument for the root menus is not the term's id! (Possibly just the menu ID)

Terms belonging to multiple vocabularies will only have one taxonomy/vocabulary pre-populated.

No proper validation that the argument is properly related to a term.

Planed features - for "Create HERE" module

  • Integration with access restrictions e.g. content types, and taxonomy etc.
  • Integrating with the "Navigation/Create" menu?
  • Handling for multi-vocabulary terms?
  • Create Here based on a current node's taxonomy
  • Admin of what content types and taxonomies "Create HERE" is active for.
  • Better validation etc.

Feature requests

Please let me know what facilities would be liked for a module and any problems that need to be overcome or avoided.
Regards

John Bryan
www.ALT2.com
Application Integration Specialists
Tel: UK 08700 3456-31

John Bryan’s picture

Should consider whether to impliment this via the menu hooks rather than the ARG function.

So far undecided {when I started writing this comment}. Whilst it is better programming, and better integration to access control etc., to use the Drupal API at the highest level it may not be a functional solution. e.g. the following are paths to the same view:-

{actually that is not a limitation after all as the arg function can always be called to suck out the term ID once module is called from a menu based hook}

Looks like the most correct approach would be use the menu hooks to define & activate when the "Create HERE" links are enabled but it seems that the menu system is designed to only call a single function/module when a menu item is enabled. I can see two approaches to get around this so that "Create HERE" is controlled by menu hooks whilst control still passes to the module/function that the menu item is really for. But I don't like either approach, especially as a Drupal newbie. For now it is best if I develope based on the ARG() function and consider a 'menu hooks' approach latter in development.

To be honest I think even in long term that for resilience and flexability this is a case where ARG() may be the better approach e.g. if another module's menu path is altered this could break the menu system link to "Create HERE"s activation, but the ARG() path remains the same even when the menu changes.

Conclusion: For now, unless an over-riding reason is demonstrated that out-weighs the resilence draw-backs, the ARG() approach is going to be used in short & medium term.

Regards

John Bryan
www.ALT2.com
Application Integration Specialists
Tel: UK 08700 3456-31

kkkk’s picture

would this also be useful for creating a forum, where the comments are replaced by proper forum posts with taxonomy access control - just a thought, that's something I am looking for

I think "create here" should completely replace the existing "create content" menu for most users, great idea

John Bryan’s picture

I see where you are comming from now, I'didn't first read - to many thoughts in my head at the time.

I think it could but then should it. Whilst the comments based drupal forum mechanism is clunky I think that is mainly due to the rendering rather the base mechanism of it. It is a threaded forum and one that works. But it could do with a collapseable (e.g. javascript) display system.

Moving to a node based forum mechanism would give more rendering options via "Views" and other modules. It would also mean that replys could be more flexible in their content. But what would be the database impacts on active/large forums of each reply.

I am too green to Drupal to suggest creating an alternative to a core built-in function that is in some ways is already better than most of the forum solutions out there (I really hate non-threaded only forums). But yes, it does seem to me that a combination of "Create HERE" functionality, a "Forum" node type (webmins could impliment what ever node type they wanted) and either taxonomy or relationship mechanisms would be a good flexible direction to go.

But forums can grow to huge sizes and I don't know at what number of taxonomy levels and node counts Drupal starts to get impractical? One paid members only forum site I use must have about 1,000,000 postings (over several years admittedly) - what stresses would that put on Drupal?

Regards

John Bryan
www.ALT2.com
Application Integration Specialists
Tel: UK 08700 3456-31

kkkk’s picture

Thank you for your comments, you are probably right about large forums etc.

I am now satisfied with the rendering, after I have configured comments as good as possible, and also added a few changes to the forum css to my theme definitions.

My main concern is, that while I can define parts of my forum to have different access for different user roles (using taxonomy access and going to administer > access control > category permissions and defining permissions for the specific forum topics) this only applies to the topics and not to the follow-up postings because they are not nodes but comments. I followed the ideas described in the handbook page "Private forums and member-only sites" (http://drupal.org/node/111576). I tried to start a forum thread about this, but it died (http://drupal.org/node/128847).

Isn't this a problem - it's my first drupal site, so I may have overlooked the way to do it right. I thought maybe your "create here" might point in the direction of a solution.

Just to explain myself - this is kind of a side issue regarding "create here"

Kind Regards,

Henning Hansen

summit’s picture

Hi,
I am also interested in this feature.
I need to be able to add a term (with parent clickable) on the add/node screen and be able to add a node on the add/category (I use the category.module.
I use drupal 4.7.6.

greetings,
Martijn

John Bryan’s picture

Regards

John Bryan
www.ALT2.com
Application Integration Specialists
Tel: UK 08700 3456-31

John Bryan’s picture

The site I especially wanted this functionality for has been re-written and is live-ish. So now I am at the stage of refining it's ease of use factor for non-tech content submitters.

Therefore I am likely to be working on this again over the next two weeks. I now also have the benefit of much greater knowledge of Drupal architecture and have the "Pro Drupal Developer" book 8¬)

If anyone has any thoughts or feature requests then let me know ASAP so I can consider them at design stage.

Regards

John Bryan
www.ALT2.com
Application Integration Specialists
Tel: UK 08700 3456-31

summit’s picture

Hi,
I am very interested in new development in this field.
I need to be able to add a term (with parent clickable) on the add/node screen and be able to add a node or more on the add/taxonomy page (I am not using the category.module anymore)
I use drupal 5.2
Thanks in advance for your reply!

greetings,
Martijn

John Bryan’s picture

Probably me being slow 8¬)

Current code on my dev site generates a "Create Here" menu on any 'Node view' or 'Node list view' page (where there is a vocabulary associated with it) is near identical to the "Create Content" menu:-

Create in "Treatments"

  • Page
  • Story
  • Web Link

But the primary vocabulary field is pre-populated with the locations term (e.g. "Treatments").

I don't get what you mean by "with parent clickable"? or by adding nodes on the add/taxonomy page (I would think you would add terms not nodes there?). Try re-stating in 'idiots guide' manner, with me as the idiot ;¬), in more than a single sentence.

P.S. I tried the category module in the past and now avoid it as well

Regards

John Bryan
www.ALT2.com
Application Integration Specialists
Tel: UK 08700 3456-31

John Bryan’s picture

This may, or may not, be part of what you were trying to say...

Just had a thought that it would an obvious feature to add the ability to create a new sub-term at the current vocabulary/term location.

Also possibly 'Edit current term/node' menu. Yes I know that if they have been given permissions to edit then (typically) there will be "Edit" links in the content area, but these get in the way of readability and layout (e.g. it doubles the length of a sub-term list). It would be more 'application like' to move these to a menu, especially if it is a drop-down 'Edit' menu where the option is grayed-out rather than missing when not available/appliable. This again would make for a better Granny/Mr Corner Grocer compatible site.

Regards

John Bryan
www.ALT2.com
Application Integration Specialists
Tel: UK 08700 3456-31

summit’s picture

Hi,

I think I understand you.
But with the normal drupal configuration you first have to make a term.
Then you have to select another screen, there you can make nodes with this term associated.
In my particular functionality request I would like to be able to make a term and in the same screen be able to add the first node for this term.
Will this be possible with your module?

Thanks in advance for your reply!

greetings,
Martijn

John Bryan’s picture

Using a free-tagging category type I have read that you can create a node and, instead of setting it's term to an existing term, set it to a non-existent term which will be created at the same time as the node and have the node associated with it.

In fact I just tried and tested it. So you can already create the node and the term from the same add-node screen.

My planed facility will allow you to browse to an existing term (especially useful in hierarchical taxonomies) and from that page (via create here menu) create a subterm that is automaticaly created in the current term, possibly (depending on behaviour settings) immediately take you into that term where you could then use the Create Here menu again to create a node there. i.e. There are still two screens but:-

  • Shorter menu path
  • Fewer form fields to fill in (therefore fields can be hidden from dumb users)
  • No need within the Add Node forms to select category & term to create the node in, it just creates it at current term location

It is not designed to automate several seperate tasks into one as such, but to make indivdual tasks simpler, more intuitive and require less input/decision by the user. One more complex task is not neccessarily easier than two or more simpler tasks.

For instance free-tagging node/term creation is quick for flat taxonomies but for hierarchcal taxonomies it always creates the new term at just below root level when perhaps you wanted it to exist several levels down.

Regards

John Bryan
www.ALT2.com
Application Integration Specialists
Tel: UK 08700 3456-31

summit’s picture

Hi John,

Your latest alinea put's the finger on the right spot. This is not possible on the current drupal configuration.
I want to be able to make a subterm on a lower level and a node related to this subterm on the same screen. Hopefully your improvements will make this work, otherwise I have to see if this will be possible with another solution.
Thanks a lot for your remarks!

greetings,
Martijn

summit’s picture

Hi John,

Your remark:
Using a free-tagging category type I have read that you can create a node and, instead of setting it's term to an existing term, set it to a non-existent term which will be created at the same time as the node and have the node associated with it.

But will it also be possible in your solution to select the parent of the term, so the subterm is created on the right place?
And if the term exists how about that?


Your remark:
My planed facility will allow you to browse to an existing term (especially useful in hierarchical taxonomies) and from that page (via create here menu) create a subterm that is automaticaly created in the current term, possibly (depending on behaviour settings) immediately take you into that term where you could then use the Create Here menu again to create a node there. i.e. There are still two screens but:

Will it please be able to place the functionality on the same page?

Thanks for your answers.

greetings,
Martijn

John Bryan’s picture

Or at least partly.

I have noticed myself the limitation in free-tagging, a good aid to finding terms in complex taxonomies, is weak in the way it adds to the same complex taxonomies by not providing a way to locate the new term within the free-tag taxonomy.

Taxonomy is possibly Drupals strongest distinctive feature yet, whilst you can create complex structures, the interface for both developers/administrators and for dumb-users is horrendously poor. It is in desperate need of some java based taxonomy editors and possibly an expanded API.

I do have some income security for a few months, so could possibly spend some non-commercial time on this (not Java interfaces though, well beyond me for now) during idle moments. But nothing is likely for the next month as I will be a grand-father for the 4th & 5th time (twins), and will be babysitting grandchildren No1, 2 & 3 for a few weeks whilst trying to do commercial work from home!

In the medium term I am likely to concentrate on the basics of wrapping a module around an expanded version of what I already have.

Martijnhaan; Can you describe how the facility you wish, a one step "Create subterm-node Here!", would be used in practise. What would it allow your users to achieve? I am having difficulty envisaging a killer real-world use for this.

Notes to self:
"Create subterm Here!" should be easy adaptation? Think I was already looking into it before?
"Create subterm-node Here!" not straight forward!
- Session variables to hold last taxonomy ("Here") term during new node creation etc? (would need to expire after use), make it generic - not just when using Create Here! an automatic last-term session variable for each taxonomy?
- Alternatively: Pass the last/current-term via url? no need to worry about expiring/resetting it then but will need to hook into node edit hooks rather than just using existing pre-populate module etc. but then so would the other method, this way simpler solution?
- How to hook into free-tagging new-term event? Don't need to - if a term has been entered for the active Create Here! taxonomy field then treat it as new, set it's parent from last-term variable.

Regards

John Bryan
www.ALT2.com
Application Integration Specialists
Tel: UK 08700 3456-31

summit’s picture

Hi John,

I saw an action (from the actions.module) on which you could add a node with actions. May be you are able to make the action "add a term to a node". So that this functionality is also covered?
http://drupal.org/node/150949 and http://drupal.org/node/135125 (for snippet on add node to a term).

Greetings,
Martijn Haan
www.gratis-informatie.nl

casperl’s picture

I have the same problem. I digress from the topic, but FWIW, here is a way that I have found to get around the issue described here:

I have noticed myself the limitation in free-tagging, a good aid to finding terms in complex taxonomies, is weak in the way it adds to the same complex taxonomies by not providing a way to locate the new term within the free-tag taxonomy.

I add a custom block shown at the top of the node/add/* and node/*/edit pages called "Help: Adding Tags" in which I display the taxonomy vocabulary of the free-tagged pages. Additionally I also display some instructions on using Free-Tagging.

Not a perfect solution, but a solution of sorts.

Casper Labuschagne
Where am I on the Drupal map on Frapper?

najibx’s picture

wish to know the outcome

-najibx-