I think the user who asked https://drupal.stackexchange.com/questions/49853/how-to-setup-go-back-button-in-views is trying to do a similar thing.

Is there a way within the Views module to add one to the node content output content from a view?

I don't want to use the Back Button module for this; I would prefer to use the Views module, if possible.

  • need an answer Please :) how to achieve this in views? – cea Feb 23 '13 at 10:46
  • Hello, and welcome to Drupal Answers. The question is a little vague: What do you mean by "add one"? To what would you need to add one? – kiamlaluno Feb 23 '13 at 11:57
  • "add one" follows on from "back button" as clearly stated in the title of question, I assumed that would follow logically without having to repeat it sorry. – cea Feb 23 '13 at 13:38
  • Thanks Patrick Kenny, I am not following the instructions in that thread unfortunately. It is beyond my experience. – cea Feb 23 '13 at 13:39

You can not do this with the views module alone. A views link will simply link you to a node page and when you are on the node page, it does not know how you got there.

you could do this, which is basically the same as pressing the browser back button:

<input type="button" value="Go Back" onclick="window.history.back()" />

or this:

  $url = htmlspecialchars($_SERVER['HTTP_REFERER']);
  echo '<a href="'.$url.'">go back</a>'; 
  • Thank you for your answer. I want to do the opposite. I want to attach the back button to the node created so that user can be directed back to list of nodes in the view. Problem is I am using a 3rd party module which creates a page on the fly when user submits and I cannot find the associated template. I have asked the module creator but while waiting I thought I'd check if possible in views. You HAVE sort of answered by saying you cannot. But I'd like to wait for other answers. – cea Feb 23 '13 at 13:35
  • What module is generating the page? You are not going to get a specific answer to where to put the code if we do not know what module is generating the page – 2pha Feb 23 '13 at 13:49
  • ms_paypublish is the module – cea Feb 23 '13 at 13:50
  • moneyscripts hey.... I can not see how the page is generated, so can't help you any more than I already have – 2pha Feb 23 '13 at 13:53
  • Yes, will have to wait for reply from them, thanks. – cea Feb 23 '13 at 13:54
<FORM><INPUT Type="button" VALUE="Back" onClick="history.go(-1);return true;"></FORM>

I am using the above in initial page for view but it is the node which needs it as well.

I invite further answers.

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