How can I add additional query parameters to a view title linked to a node? I have a view (using the calendar module), which displays a title field for each displayed event. The title field is set to "link this field to the original piece of content".

I'd like to rewrite that link to add some additional parameters, e.g. ?return_view=myview, so that I can link back to the view page from the content. The content might be linked to from any one of several different views, so it needs to take some parameter (i.e. return_view) to tell it what to link back to.

I've tried adding a hook_views_pre_render:

function mymodule_views_pre_render(&amp;$view) {
    if ($view-&gt;name == 'myview') {
        foreach ($view-&gt;result as &amp;$r) {
            $r-&gt;node_title = array(
                '#theme' =&gt; 'link',
                '#text' =&gt; 'xyz',
                '#path' =&gt; 'node/' . 123,
                '#options' =&gt; array(
                    'query' =&gt; array(
                        'rv' =&gt; $view-&gt;name,
                        'rvd' =&gt; $view-&gt;current_display
                    ),
                    'attributes' =&gt; array(),
                    'html' =&gt; FALSE
                )
            );
        }
    }
}


But that just leads to Drupal complaining that "warning: htmlspecialchars() expects parameter 1 to be string, array given in check_plain()" - I'm assuming because some rendering function somewhere expects to get a plain string.

What's the cleanest way to add additional query parameters to a node title rendered by views?
You can do this in Views.  


Add a new field to the View "Content: Path".
Check Exclude from display.
Click on Rewrite Results and the check "Use absolute link".  
Click Apply button to Save.
Rearrange your fields so "Content: Path" is above "Content: Title".
Click on the "Content: Title" field.
Uncheck "Link this field to the original piece of content".
Click on Rewrite Results and check "Output this field as a link".
In the Link path textbox enter "[path]?return_view=myview".  (You can use the path replacement pattern because it is above the title field in the field order)
Click Apply.