Attached patch provides a hook that node modules can use to override the behavior of taxonomy_render_nodes() when displaying terms from a single vocabulary that applies to only one node type. (i.e. a vocabulary that applies to images only could be rendered with a gallery page instead of the standard node teaser formatting.)

Comments

pfaocle’s picture

Brilliant! This should achieve whats brought up in this issue: http://drupal.org/node/23782

Eric Scouten’s picture

StatusFileSize
new1.01 KB

Sorry... wrong patch format before.

pfaocle’s picture

Just been trying out this patch, to no avail: patched taxonomy.module, created an image_render_nodes() function in a test image.module to override the default output... is there a last step? Eg:

  -function taxonomy_render_nodes($result) {
  +function taxonomy_render_nodes($result, $vid = 0) {

will the $vid now need to be passed to taxonomy_render_nodes() for this to work?

Apologies if I missed something.

Eric Scouten’s picture

Status: Needs review » Active

Actually, there are probably two more pieces to make this fully work, so I'll take this back to the drawing board.

(1) Yes, a vid needs to be passed to taxonomy_render_nodes() if the call comes from within taxonomy.module. Otherwise, this patch is a no-op.

(2) taxonomy_menu.module needs to be patched to pass the vid when it calls this function. That's a separate patch that I'll need to submit. That gets complicated for me since I have several other patches in the queue for that module.

I'll work on an updated patch. ETA: later this week. Worst case: Sunday evening.

ricabrantes’s picture

Version: x.y.z » 7.x-dev
Status: Active » Closed (fixed)

bump.

ricabrantes’s picture

Status: Closed (fixed) » Active
catch’s picture

Status: Active » Closed (duplicate)

taxonomy_render_nodes() has completely vanished in Drupal 7, you can do everything needed here with hook_page_alter() hook_menu_alter() hook_term_path() or various other options.