I have a drupal template that renders some content like this:
<?php $field_collection_state_info = reset($content['field_state_information']['0']['entity']['field_collection_item']); ?>
<?php print render($field_collection_state_info['field_state_name']); ?>
but I would like to run the php ucfirst() so all rendered content is capitalized on the first letter.
I tried this:
<?php print ucfirst(render($field_collection_state_info['field_state_name'])); ?>
But that didn't work.
How should I achieve this?
Any advise is very much appreciated.
C
I think you will have to change the content of your render array before calling
render():EDIT Try adding this into your
template.php, it changes the value for a collection_field usinghook_preprocess_node():