6

I am trying to create a taxonomy redirect for specific taxonomy URL. Basically what Taxonomy Redirect did for Drupal 6 but for Drupal 7. I have searched the Drupal 7 API for hook_term_path but don't see it.

Finally, I need these links to be associated with particular profile2 profiles.

Is this possible?

4
  • for drupal 6 there's a taxonomy redirect module. – AjitS Sep 18 '12 at 15:15
  • not for Drupal 6 .... Drupal 7... I think the closest is TVI... but I haven't used it. – Sun Rhythms Sep 18 '12 at 22:45
  • 1
    updated my answer for doing it the custom module way and a way to use the contrib module – junedkazi Sep 21 '12 at 18:54
  • thnx for the information – Sun Rhythms Sep 21 '12 at 20:54
3

Instead of hook_term_path you can use hook_entity_info_alter.

A small example

function MYMODULE_entity_info_alter(&$entity_info) {
  $entity_info['taxonomy_term']['uri callback'] = 'MYMODULE_term_uri';
}

and then you can implement you version of MYMODULE_term_uri function.

Hope it helps.

Also if you want the D7 version of the module you mentioned you should try http://drupal.org/project/entity_path

4
  • Do you know how to create an argument for profile 2 fields for a block with this in mind so that any particular user can see information via a taxonomy term for any other particular user. I'm always interested in going the custom module route but worried that there is some incompatibility with something already previously installed. – Sun Rhythms Sep 21 '12 at 20:48
  • I am actually clueless as to what you want to achieve. Can you give some more information. If you want to go the custom module way I just mentioned above the hook and MYMODULE_term_uri will be the custom function where you can do all the necessary changes you want to do. – junedkazi Sep 21 '12 at 22:21
  • I'm just trying to create a dynamic view for profiles2. I need to have a view showing fields of one user at a time. I wanted to create the view and redirect my taxomy term to it. I assumed to take a taxonomy redirect approach since all users of a specific type will have a unique tag so it becomes a basic identifier. Some may share the tag, some may not, which gives me the option of grouping. That's basically it in a nutshell - I'm stuck at trying to find a solution to show a user profile via views. I only need to show one profile because only one user roll will have that profile control. – Sun Rhythms Sep 22 '12 at 0:32
  • Back to the drawing board – Sun Rhythms Sep 22 '12 at 0:39
1

drupal.org/projects/tvi seems the closest for drupal 7. It actually does what I need. I am just concerned that its not needed since what it does could be done with managing the fields of taxonomy and this doesn't point directly to specific nodes created by views for profile 2.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.