I'm rendering a user customer profile in a form using the code:
$profile = profile2_load_by_user($account, 'customer');
$form['customer_profile'] = array(
'#type' => 'item',
'#markup' => render($profile->view('block')),
);
which works rather well, except that the title (in H2 tags) is rendered as a link back to the profile.
I want to get rid of that link, but as there seems to be no obvious property, to specify if you do or do not want a backlink. Not in the $build
array parameter of hook_entity_view_alter, nor in the $elements
parameter for a '#pre_render' callback. In a '#post_render' callback, it's too late because the link is already inserted into html.
So, how do I get rid of it?