Re: token in code field in Display suite

Paul Rijke <[email protected]>
Newsgroups gmane.comp.php.drupal.support
Message-ID <CANUh=GPddR-JanmcJD_HuafptncqXq8Sin5ne00Kt-CB6ee=1g@mail.gmail.com>
Could it be​ that de field referenced is wrong?

I am no php programmar, but in examples I see $node->field_project_type used


2014-07-26 0:55 GMT+02:00 Don <[email protected]>:

>  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
>
>
> --
> [ Drupal support list | http://lists.drupal.org/ ]
>

-- 
[ Drupal support list | http://lists.drupal.org/ ]
Fane-th.png (image/png, 17.9 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.