it would be great to have the tags clickable and shows then the users that have the same tag

Comments

joachim’s picture

We could provide the same sort of system as taxonomy_redirect, and have an admin setting for a base path for terms to link to (which if blank produces no link at all).

Then we can also provide a default view of users by taxonomy term.

I don't have time to work on this myself, but I'll review a patch :)

joachim’s picture

See #724880: work with user account page API which should get in before more work is done on this part of the code.

mstef’s picture

I'm going to work on this now (just like I did for http://drupal.org/node/617088)

My plan is to link the terms to the regular taxonomy page, use the user_terms module to create tabs on the tax page for 'Content' and 'Users' (made possible by overriding the menu of taxonomy.module).

Sound good or what??

mstef’s picture

Hmm..I see a user_terms.views.inc but no sign of functionality from within views at all?? Not that it matters, it just would probably be easier to create a custom view and link the terms to that...

Edit: Ohh there you are hiding -> User: Term ID. Gunna look deeper into this and determine the 'best' way to handle clicking. Open to suggestions..!

mstef’s picture

Maybe it would be ideal for the module to ship with an already enabled view that handles this, and just link the terms to it...

?

joachim’s picture

Yup, the sensible thing to do would be to provide a default view and link to that, eg at /user/term/TID or maybe user/profile/term/TID if that doesn't cause menu clashes with the presence/absence of profile module.

Of course then we should really provide an analogue to http://api.drupal.org/api/function/hook_term_path/6 so another module can come along and do something like http://drupal.org/project/taxonomy_redirect.

mstef’s picture

Both ways have their pros and cons. I like using views because then you can edit it and bring in other data. But having it tab off of regular taxonomy pages, lets users toggle between content and users that have those tags.

I'm going to have to think this over for a little..

joachim’s picture

Tabs on taxonomy pages requires more work -- you'd need to hack taxonomy module's menu items in hook_menu_alter(). It also feels rather more idiosyncratic, as on a lot of sites it will mess up existing taxonomy or be unsuitable.

Here's what I'm thinking:

- User Terms has a central setting for user terms being links or not
- calls hook_user_term_path to get the path for links
- by default, links terms to its default view

Other modules can step in on top of this, implement hook_user_term_path and sent it to taxonomy tabs as you suggest, or to user-defined paths.

scarer’s picture

How is work on this progressing? Is it going to be released any time soon?

scarer’s picture

If you are waiting on the module update you can make the terms clickable by creating a custom user-profile.tpl.php file. This is the kind of code you'll be looking at:


      $tags .= '<h3>Profile Tags</h3>';
      //retrieve user account terms
      foreach ($account->user_terms as $value)
      {
         $tags .= '<a href="../taxonomy/term/' . $value['tid'] . '" title="' . $value['name'] . '" alt="' . $value['name'] . '">' . $value['name'] . '</a> 
         &nbsp; &nbsp;';
      }

Hopefully this helps someone ;D

joachim’s picture

Version: 6.x-1.0-beta3 » 6.x-1.x-dev

Given how many options there are here, I wonder whether we should do this in a separate module within this project, which would allow a different path to be set for each vocab.

zmz’s picture

> Hopefully this helps someone
> scarer

thx 4 aiming

my noob src for clickable tags with hierarchical_select
hierarchical_select/includes/theme.inc

    $items = array();
    foreach ($lineage as $level => $item) {
		// $items[] = $item['label'];
		$url_ins=$item['value'].'" title="'.$item['label'].'" alt="'.$item['label'].'">'.$item['label'];
		$items[] = ' <a href="/taxonomy/term/'.$url_ins.'</a>';
    }
    $output .= implode('<span class="hierarchical-select-item-separator">›</span>', $items);
  }
Katrina B’s picture

I, too, am interested in having clickable terms.