Here is a module to display a node for a vocabulary. It adds on to taxonomy_menu and with one slight change could be independent of taxonomy_menu.

The details are at
http://petermoulding.com/technology/content_management_systems/drupal/mo...

The readme is at
http://petermoulding.com/technology/content_management_systems/drupal/mo...

The module is at
http://petermoulding.com/technology/content_management_systems/drupal/mo...

The SQL is at
http://petermoulding.com/technology/content_management_systems/drupal/mo...

Comments

venkat-rk’s picture

This sounds exciting. I will be thankful for clarifications to the following questions before I try it out:

1.) Am I right in thinking that, with this module installed on top of taxo_menu, one gets an index page for a given vocabulary that will pull up the latest nodes of terms in that vocabulary?

2.) Does this handle pagination when the nodes in a vocabulary exceed more than one page of display?

3.) Copyright- can I use this on my personal site?

4.) Database relation integrity- any potential negative consequences?

Thanks in advance.

peterx’s picture

4/ Drupal does not use MySQL's referential integrity because MySQL's referential integrity is a relatively new feature that you get when you use the MySQL InnoDB tables instead of the MySQL MyIsam tables. You should insist on referential integrity for financial applications. For Web stuff referential integrity is just another overhead that can slow down read access.

The worst that might happen, if your Web server crashed while you are deleting a node, is that the node id will remain in the vocabulary_node table and you will have to delete it through administer > vocabulary node > delete.

3/ You can use it on any Drupal based site. I am only stopping people from using the code in sites where you have to pay for the code or for support. I hear that Mambo are now restricting access and Mambo developers have deserted to set up a new product. They could upgrade to Drupal.

IMDB.com used to be open source but then the person who owned the site sold it to Amazon. I might GPL all my Drupal related code after Drupal set up the Drupal foundation.

If I do not GPL my code, I will LGPL which means you can use it in Drupal as if it is GPL and I can also sell it with a BSD style license to people who sell code for cash.

2/ No pagination. Function vocabulary_node_get_content($_GET['q']) uses node_load() and node_show(). You can also call vocabulary_node_get_node_id_from_request($_GET['q']) which will return the node id so you can display the node your way.

You could also point me to an example of Drupal paginating a node so that I can add pagination. The trick will be seeing how pagination works with taxonomy_menu.

1/ This module displays a node using node_load() and node_show(). The node could contain anything. There are modules to create taxonomy indexes. Currently I am using book pages where I need an index within a page which means I have not yet looked at an index.

If you look at http://petermoulding.com/books/, the text at the top of the page is the node. In the public site, the menu is built with menu_otf and the node is manually displayed. In the test version of the site, books is a vocabulary named Books. taxonomy_menu makes the books vocabulary the high level entry in the menu. The node content is in a node named Books. vocabulary_node makes the books node display in the page you see when you click on the books entry in the menu.

The books node could contain content build by one of the other taxonomy modules. I have not yet tested the other taxonomy modules.

I wanted an index at http://petermoulding.com/technology/content_management_systems/drupal/ and I used the book module because that also gave me the next link.

0/ The two things I could not get out of taxonomy were a node displayed as the home page and a node for each vocabulary entry in the menu built by taxonomy_menu. I wrote the home page module using code that does not use taxonomy and then I created vocabulary_node by looking through taxonomy_menu.

My code is cleaner than taxonomy_menu because my code does less. I look only at the vocabulary level, not at the term structure. The one messy bit is that I currently look at the request and decode a request of the form taxonomy_menu/9. If you were to use an alternative to taxonomy_menu then that one line of code would have to detect the menu module in use and change the decode to suit the menu module.

venkat-rk’s picture

Thank you for taking the time to write such a detailed reply. Much appreciated and hardly any doubts now. I have a feeling your effort is going to be useful for Jeremy Epstein in his work with the proposed category module.

Regarding pagination, there are a couple of efforts that can be found in the postings on the following thread from this comment onwards:
http://drupal.org/node/23362#comment-40600

Thanks again.

peterx’s picture

See http://drupal.org/node/39125 for a change to taxonomy_menu that replaces the top level of the menu with the top level of the term. It is an easier approach that should work with distant parent and other stuff. I am deleting vocabulary_node from my system.

petermoulding.com/technology/content_management_systems/drupal/modules/modules_not_used/vocabulary_node

petermoulding.com/web_architect