0

I need to get the previous (referrer) NID into a variable on a page. After saving new content of a certain content type a rule will redirect the visitor to a set page where I would like to have the NID of the new node to play with. Can anyone point me in the right direction? I think its possibly going to be one of those ones that you'd think is simple but ends up being awfully complex but I'm really in need of a solution and can't find anything very relevant.

Thanks in advance folks!

1

You might be able to create a rule based on this:

  1. event: After content has been saved...
  2. condition: content is new
  3. condition: content is type (select type)
  4. action: page redirect: fill in page here with tokens based up content above

In the page direct you can create a query variable after the ?, eg foo=[TOKEN], and then in your page, you can access that variable via $_GET['foo'] or $_REQUEST['foo'].

  • Good thinking Jimajamma! Thanks for the super quick response. – Ballboy Jul 9 '12 at 22:29
  • ps. I just tried it and it works a bloomin' treat, thanks again! – Ballboy Jul 9 '12 at 22:44
  • my pleasure, quite welcome! – Jimajamma Jul 10 '12 at 1:31

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.