I am getting my feet wet with D7 and came up against something that I haven't been able to Google yet. I am using views to get a list of variables in a custom block. One variable is:
$fields['field_main_image_large_title']->content
If I want to print out this variable I use:
print render $fields['field_main_image_large_title']->content;
Now I like to use this field as part of a url in a link. In D6 I'd just do:
<a href='my/url/<?php print $fields['field_main_image_large_title']->content; ?>'>myLinkTitle</a>
I tried this for D7 like this:
<a href='my/url/<?php print render $fields['field_main_image_large_title']->content; ?>'>myLinkTitle</a>
and while it inserts the variable string into the url, I get several spaces before and after the string. I am dealing with this at the moment in using the trim function on $fields['field_main_image_large_title']->content;
I am doing this in a views template.
While this works it feels like a hack and I am looking for somebody to point me in the right direction on how to do this the Drupal 7 way...