How can I programmatically insert values into Global custom text field from the views. I have tried using the $views variable from the hook_views_pre_render(&$views) and my_theme_name_process_function(&$vars) but was unsucessful in getting the value ? When I try for a simple field I can insert html into the markup programmatically.
$view = view Object
(
[db_table] => views_view
[base_table] => node
[base_field] => nid
[name] =>view_name
[vid] => 3
[description] =>
[tag] => default
[human_name] => view_name
[core] => 7
[api_version] =>
[disabled] =>
[editing] =>
[args] => Array
(
)
[use_ajax] =>
[result] => Array
[result] => Array
(
[0] => stdClass Object
[field_field_final_ort] => Array
(
[0] => Array
(
[rendered] => Array
(
['#markup'] => YES
I want to similarly change the value of GLOBAL custom text field using views object but there is not such array for global custom text field.
What is the way for changing it?
My code was
function my_themename_process_views_view_field(&$vars) {
if ($vars['view']->name == 'view_name') {
foreach( $vars['view']->result as $key => $value) {
$value->field_name[0]['rendered']['#markup'] = '';
}
}
I want to apply this similar code for global custom text field but there is no suxh available inside result array
How can I alter values for each row of global custom text field value ? The answer given below gives same values for each row .