Hi there,

Is it posible to get field label tokens?

and that would only print if the field has a value?

Thanks

Comments

manoloka created an issue. See original summary.

anmolgoyal74’s picture

Assigned: Unassigned » anmolgoyal74
Status: Active » Needs review

Yes , You can generate title using field tabel tokens.
but if you want to print only if the value is there, then you have to use PHP to provide Pattern for the title.
for eg if you want body as your title (only 120 character from the body)

<?php
if (empty($node->body[$node->language][0]['value'])) 
 $node->body[$node->language][0]['value'] = '';
 $out = truncate_utf8(strip_tags($node->body[$node->language][0]['value']), 120, true, true);
 return $out ? $out : 'Node Title';
?>
gaurav.kapoor’s picture

Status: Needs review » Fixed
gaurav.kapoor’s picture

Status: Fixed » Closed (fixed)