Search code examples
drupaldrupal-7view

Alter field text of the view in Drupal View


I have a view for taxonomy term. And show the list of nodes. I need to alter field text (link element). I try to use views_pre_render hook. in it i do something like this: foreach ($view->result as $key => &$result); $result->field_field_show_buy_tickets[0] (it s my field) and in this array I have ['raw'], ['rendered'] and I need to change link title.


Solution

  • It's not very clear from your question what you're trying to achieve.

    Assuming you want to change the link text in a view, you could go to the field configuration/settings in your view and try using rewrite options and replacement patterns

    Alternatively you could look at views-view-fields.tpl.php and/or template_preprocess_views_view_fields.

    Also, check out this discussion