How to set one variable for each link on a views un-formatted list I'm trying to create a variable to put in a l() function. It's the $rellink below.

&lt;?php print l('&lt;span class="link-spanner"&gt;&lt;/span&gt;', "$rellink", array ('html' =&gt; TRUE)); ?&gt;


I have a list of content nodes I'm displaying in an un-formatted view. I want $rellink to be the link for each of them. So on item 1, it's the link to item 1. On item 2 it's the link to item 2 and so forth.

In the unformatted.tpl.php file I can print out 

&lt;?php print $view-&gt;style_plugin-&gt;row_tokens[$id]['[view_node]']; ?&gt;


Which will print the correct link. But I need this inside the link part of the l() function and when I copy and past it in, it doesn't work.

So the question is, what have I done wrong there or if that's not possible/bad practice how do I set-up a variable in my preprocess function that I can use instead?

I've tried this in the preprocess funtion:

$view = $variables['view'];
$rellink = $view-&gt;style_plugin-&gt;row_tokens['$id']['[view_node]'];


But it doesn't recognise the global $id variable and I get an un-defined variable rellink variable warning anyway.
I accidentally left the quotes in when entering the variable path so it didn't work. I was entering:

&lt;?php print l('&lt;span class="link-spanner"&gt; a&lt;/span&gt;', "$view-&gt;style_plugin-&gt;row_tokens[$id]['[path]']", array ('html' =&gt; TRUE)); ?&gt;


And the I should've been putting in:

&lt;?php print l('&lt;span class="link-spanner"&gt; a&lt;/span&gt;', $view-&gt;style_plugin-&gt;row_tokens[$id]['[path]'], array ('html' =&gt; TRUE)); ?&gt;


When you're calling a value in an array, it won't work if you put the path in quotes.