0

I'm using drupal's core search module with pathauto module for URL aliasing. I have one testimonials page where different contents under testimonials category get display in this page. Now, in the search results one of these content get display and lead to node/35 and node/36 in same search result page.

In URL alias I tried to give /testimonials in each content but it gives error that this URL alias is already in use.

I want to redirect this link on the testimonials page (abcd.com/testimonials). Means

node/35 -> abcd/testimonials
node/36 -> abcd/testimonials
node/37 -> abcd/testimonials

How can I achieve this? Any suggestions or links will be appreciate.

Thanks in advance...

3 Answers 3

1

Finally got solution, but still I think this is not right way to achieve this. First enable the Pathauto module and make some pattern for particular content type. Then install the Redirect module. You can find URL Redirects under URL alias option in edit mode of content type.

click on Add URL redirect and add your desire path (in my case path to page /tesimonials). Thats it. It will redirect particular node to your given redirect path.

Hope this will help you...

0

Take a look at Customize the search results page. Check for available variables.

also search-results.tpl.php to alter the display.

0

Hi just write a code block in in template preprocessor or hook_init() function

if((arg(1) = 'node') && (in_array(arg(2), array(35,36,37)))) {
  drupal_goto('abcd/testimonials');
}

Hope it will help you.

2
  • a hook_init just for this ???
    – AKS
    Feb 19, 2013 at 14:00
  • yes we can use in hook_init() Feb 20, 2013 at 7:14

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.