Printing out path from views - /drupal/ appears twice I'm using this to print out a custom link format in views. I'm using it in the unformatted views tpl.php file.

&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;


This line calls the relevant HTML path:

$view-&gt;style_plugin-&gt;row_tokens[$id]['[path]']   


For example it might contain the value: localhost/drupal/node/31.

But when I put it in the l() function I get localhost/drupal//drupal/node/31.

Anyone know how I can stop the double print out? This is driving me mad.
&lt;?php print l('&lt;span class="link-spanner"&gt;&lt;/span&gt;',
'node/' . $view-&gt;result[$id]-&gt;_field_data['nid']['entity']-&gt;vid, 
array ('html' =&gt; TRUE)); ?&gt;


Here is the final solution.

It will add the NID on the end of node/ and create the internal path "node/x". If you're using Pathauto this will still work.