简体   繁体   中英

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM