Include Views output in href I am trying to create a custom button in Drupal 7.  The link which the href should be equal to is dependent on the context such as the current UID.

I have created a view which normally has a plain text output as [title].

I want to use that text output as part of a link field such as

http://my-site.com/page/title


so I had written the code for the above link as such:

&lt;a href="http://my-site.com/page/&lt;?php $block = module_invoke('views', 'block_view', 'profile3-block_4'); print render($block[content]); ?&gt;"&gt;LINK TEXT&lt;/a&gt;


however the output seems as if it is placing part of a views div tag in the link instead. I tried stripping all html from the views block but no success.  Anyone got ideas? Could it be an improper use of quotes?
You can try like this:

$block = module_invoke('views', 'block_view', 'profile3-block_4'); 
$url = render($block[content]);
Assume your Output will be &lt;div&gt;TITLE&lt;/div&gt;
then use **$url =  strip_tags($url);**
&lt;a href="http://my-site.com/page/".$url&gt;LINK TEXT&lt;/a&gt;
It will be better to use **l()**
l(t('Link text'), 'http://my-site.com/page/'.$url);


If you are still facing issue request you to provide block html output.