programmatically change link URL in view I have a view that shows all of a particular user's content (content the user has created on the site). This works fine, but I need to link the results (title field) to the pages where the content is displayed - not to the original node of the created content. 

Since the content types may be different, I guess I need to set the URL's programmatically. 

For example one content type is "projects" projects are displayed at site.com/projects/!arg

Another content type is "photos" photos are displayed at site.com/photos/!arg. 

How do I write a conditional that will set the URL's correctly?
I don't recommend to use views php module,

Menu item with callback:

The idea here is to override all the links of the titles in your view with one link which pass an argument to custom menu callback, then in the callback, you write your PHP code which does the routing.

to implement this solution you need to do the following:

1- Override the link in the view



2- Create callback using hook_menu():


/**
 * Implements hook_menu().
 */
function mymodule_menu() {

  $items['my-routing/%node'] = array(
    'title' => 'Custom callback',
    'page callback' => 'my_custom_callback',
    'page arguments' => array(1),
    'access callback' => TRUE,
    'type' => MENU_CALLBACK,
  );

  return $items;
}


3- Create your custom callback to do the routing:



function my_custom_callback($node) {
  switch ($node->type) {
    case 'product' :
      drupal_goto('project/' . $node->nid);
      break;
    case 'post' :
      drupal_goto('blog/' . $node->nid);
      break;
  }
}