#drupal7 #theme #template #variables #print render

Events happening in the community are now at Drupal community events on www.drupal.org.
wernerglinka's picture

Changing a variable prior to print in D7

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>

Read more
Subscribe with RSS Syndicate content