[support] token in code field in Display suite

Don donald at fane.com
Fri Jul 25 22:55:30 UTC 2014


Doesn't look like ' [node:field_project_type] ' has any real value in 
the if() statement.

-Don-


On 7/25/2014 6:36 PM, Bert Van Kets wrote:
> Hi all,
>
> I need to change the title of a node depending on the value of the field
> field_project_type. I created a "PHP code" code field in display suite
> and added the following code:
>
> <?php if ([node:field_project_type] == 'Project') { ?>
> Project [node:title]
> <?php } else { ?>
> [node:title]
> <?php } ?>
>
> However, I get the following error:
>
> Parse error: syntax error, unexpected ':', expecting ']' in
> /var/www/wallfish/modules/php/php.module(80) : eval()'d code on line 1
>
> What am I doing wrong?
> I can't find any correct way to get the value of that field through a token.
>
> Thanks.
>
> Bert


-- 

-- 
-Don Pickerel-
Fane Software

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20140725/327ece24/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Fane-th.png
Type: image/png
Size: 18361 bytes
Desc: not available
Url : http://lists.drupal.org/pipermail/support/attachments/20140725/327ece24/attachment.png 


More information about the support mailing list