<div dir="ltr"><div style="font-family:trebuchet ms,sans-serif" class="gmail_default">Could it be that de field referenced is wrong?</div><div style="font-family:trebuchet ms,sans-serif" class="gmail_default"> </div><div style="font-family:trebuchet ms,sans-serif" class="gmail_default">
I am no php programmar, but in examples I see $node->field_project_type used</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-07-26 0:55 GMT+02:00 Don <span dir="ltr"><<a href="mailto:donald@fane.com" target="_blank">donald@fane.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<div>Doesn't look like '
[node:field_project_type]
' has any real value in the if() statement.<br>
<br>
-Don-<br>
<br>
<br>
On 7/25/2014 6:36 PM, Bert Van Kets wrote:<br>
</div>
<blockquote type="cite">
<pre>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
</pre><span class="HOEnZb"><font color="#888888">
</font></span></blockquote><span class="HOEnZb"><font color="#888888">
<br>
<br>
<div>-- <br>
<br>
<div>-- <br>
-Don Pickerel-<br>
Fane Software<br>
<img alt="" src="cid:part1.01030106.02080706@fane.com" width="66" height="70"><br>
</div>
</div>
</font></span></div>
<br>--<br>
[ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br></blockquote></div><br></div>