How can I trigger rerender of an element in a preprocess function? Update: My current solution is to use the Field formatter conditions module, to suppress output of the fullname field when a first name is present.  It seems like it should be very simple to replace the value of the fullname field with the contents of the two name fields and hide those fields, but my node.tpl.php file seems not to do anything now that I'm using display suite and I can't figure out how to accomplish what I want in template.php.  Some help with that would still be greatly appreciated.

Note: I would like not to create a module just for the purposes of wrangling a couple of fields.  I am still looking for an answer to this, or a solid explanation of why a module is definitely the right way to go.

I'm probably taking the wrong approach to this.  With everything I try to do, I seem to try every wrong way first before throwing up my hands and asking the internet to tell me the right way, and invariably the right way feels wrong.

Today, I'm trying to replace the value of one field in a paragraphs bundle item with the values of two others. Here is the relevant code from template.php:

function enviroscope_preprocess_paragraphs_items(&amp;$variables, $hook) {
    $element = &amp;$variables['element'];
    foreach ($element['#items'] as $delta =&gt; $item) {
        if ($element[$delta]['entity']['paragraphs_item'][$item['value']]['#bundle'] == 'doc_other_contrib_pb') {
            $person = &amp;$element[$delta]['entity']['paragraphs_item'][$item['value']];
            if (isset($person['field_pb_doc_other_first_name']) &amp;&amp; isset($person['field_pb_doc_other_family_name'])) {
                $person['field_pb_doc_other_fullname'][0]['#markup'] = $person['field_pb_doc_other_first_name'][0]['#markup'] . ' ' . mb_strtoupper($person['field_pb_doc_other_family_name'][0]['#markup']);
            }
        }
    }
}


I verified that the #markup element of the fullname field is updated, but everything still shows up the same. Is there anything I can do to rerender?
If I need to manipulate the text and/or display based on some PHP logic, I would do it using hook_node_view(). Implement this HOOK in you custom module. Use of this module will be like.

function MYMODULE_node_view($node, $view_mode = 'full', $langcode = NULL) {
    if( $view_mode == 'full' ){
        if( $node-&gt;type == 'YourContentType' ){
            $node-&gt;content['field_pb_doc_other_first_name'] = array(
                '#markup' =&gt; $node-&gt;content['field_pb_doc_other_first_name']['#markup'] . ' ' . mb_strtoupper($node-&gt;content['field_pb_doc_other_family_name']['#markup']);
        }
    }
}


My logic may be wrong, you need to check the $node variable inside this function for all the fields value.
The above code is just a sample code to demonstrate use of HOOK_node_view.