Change a block programatically, accesing to the Views results I have a Views block, which prints a list of products, in unformatted text. I would like to wrap each of these items with a custom href string, which is somehow convoluted and so it is difficult to set in the Views options. I have managed to do so, by retrieving the Views results with hook_views_pre_render and

foreach($view-&gt;result ...


and then print the results directly to screen. If I use, instead, 

block_view_VIEWS_MY_VIEW_BLOCK_alter and

$data["content"]["#markup"]


I have the problem that the data is in raw form and cannot achieve my initial goal.
What method should I do for this apparently simple goal? I want the block to be finally printed by Drupal, even if modified with the href added programatically, but the rest of properties (pager, etc.) remaining untouched. Thanks!
Reading from some sources and experimenting a little, I have been able to reply to my question. In your template, you must put the views-view-unformatted.tpl.php file (from themes folder), and there you can modify each of the rows based in some logic (though logic should be constrained to template.php y from there populate a variable in this tpl).
The output of the view must be unformatted text, and the "auxiliary" data must be added, but hidden from view.

&lt;?php

/**
* @file
* Default simple view template to display a list of rows.
*
* @ingroup views_templates
*/
?&gt;
&lt;?php if (!empty($title)): ?&gt;
&lt;h3&gt;&lt;?php print $title; ?&gt;&lt;/h3&gt;
&lt;?php endif; $i = 0;?&gt;
&lt;?php foreach ($rows as $id =&gt; $row): ?&gt;
&lt;div&lt;?php if ($classes_array[$id]) { print ' class="' . $classes_array[$id] .'"';  } ?&gt;&gt;
&lt;?php 

if($view-&gt;result[$id]-&gt;taxonomy_term_data_description != ""){
 // Here I use a logic to show only the item name surrounded by dots.
  print ".." . $row . "..";
}else{
 // Here I use opposite logic to show the link
     print "&lt;a href='" . $view-&gt;result[$id]-&gt;taxonomy_term_data_description . "'&gt;" . $row . "&lt;/a&gt;";
} // if
$i++;
 ?&gt;