Sorry I'm not a coder so I probably shouldn't post here..But I can't figure out how to do this.

When a user is redircet to example.com/user/login?destination=cart%2Fcheckout (in my case from Ubercart)
If the user click the "Create new account" tab it goes to example.com/user/register without keeping the destination parameter.
Is it possible to take the user to example.com/user/register?destination=cart%2Fcheckout instead?

Comments

chinita7’s picture

bblake’s picture

Status: Active » Closed (won't fix)

Marking as "won't fix" as this is not a purl issue.

The issue you're running into is that those tabs are generated by Drupal's menu system, and are not generally modifiable. What you may want to do is alter the form for login, create account etc to add a redirect param ( http://drupal.org/node/134000 ) as opposed to trying to modify the links.

Alternately, you could add some javascript to the page that rewrites the links for you based on whether there's a destination in the url.

chunty’s picture

Add this to your template.php

function phptemplate_menu_item_link($link) {
  if ($link['tab_root'] == 'user' && !empty($_GET['destination'])) {
		$link['localized_options']['query'] = drupal_get_destination();
	}
  return l($link['title'], $link['href'], $link['localized_options']);
}

I wrote a blog post here: http://tappetyclick.com/blog/2013/04/11/maintain-destination-drupal-user... about why I needed to this in case it helps