1

I need to give custom path for one of my taxonomy term page which will be redirected to view page. Example:- I have view page called testimonial and in my taxonomy i have a term called user testimonials which should be redirected to testimonial view page once user click on the term.

I have tried taxonomy menu but its custom path feature is no more available. Any suggestion, how can i complete this functionality.

2 Answers 2

1

Here is sample code that will allow you to redirect all taxonomy paths to a custom URL.

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

function _sample_taxonomy_term_uri($term) {
  return array(
    'path' => 'path-to-your-view/' . $term->tid,
  );
}

Hope this helps.

0

Using the pathauto module you can configure URL patterns for your taxonomies.

But I think you are describing a different scenario. You have just one term (testimonials) that you want to lead to a different page (a View). I don't think that the pattern you are following is correct for this requirement. You're trying to do something like categories in WordPress.

You'd probably be better off creating a new content type called "testimonials".

Is there a reason you're using a taxonomy to do this?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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