Passing a contextual filter value to a view via a link with entityreference prepopulate? I have two content types, Ad and Reply (think of how posting works on Craigslist for the Ad, and the Reply is an on-site form to reply).  I am using Entity Reference Prepopulate to automatically create an entity reference back to the Ad when users click a link to make a Reply.  The link looks like this:


  node/add/reply?field_reply_orig_node=NID


Where NID is the node ID (filled in with a token using Panels).

Using Panels, I'd like to display the original Ad on the Reply edit page (to make it easier for users to write their message.  I have overriden the node edit page (using Page Manager) and I added a view that has a contextual filter (NID).  However, I don't understand how to pass a value for NID to the content pane using the reply link.

Ideally, I could make use of the ?field_reply_orig_node=NID that is already present in the link (how?), but if that is not possible, I could rewrite the link in Panels.  I just don't understand how to rewrite it so that the contextual filter can pick up the value.
One solution would be to add a custom panel to a panel page overriding the node edit form.

To do so you'll want to go into Panels Page Manager (/admin/structure/pages) and enable node_edit adding a variant that uses context to evaluate Node: type where Node being viewed is type "Your Content Type"

Then go into the panel page content section and choose "New Custom Content" from the panel selection dialog.

In the dialog that opens, makes sure to choose and input format that allows hyperlinks.

Make sure "Use context keywords" is checked and in the substitution choices you'll see %node:nid

You can use this to build the url:

&lt;a href="/node/add/reply?field_reply_orig_node=%node:nid" title="Add Reply&gt;Reply&lt;/a&gt;