Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
It would be great if you could add support for tokens before the PHP-code is executed.
Then I could do something like
return [node-nid] * 10;
Comments
Comment #1
Daniele Testa CreditAttribution: Daniele Testa commentedI know that I can use this module for markup mode:
http://drupal.org/project/token_filter
But then I do not have access to the $data variable or the views attributes.
Comment #2
Bilmar CreditAttribution: Bilmar commentedsubscribing
Comment #3
harking CreditAttribution: harking commentedSubscribing
Comment #4
John Bryan CreditAttribution: John Bryan commentedsubscribing
Comment #5
Isostar CreditAttribution: Isostar commentedSubscribing
Comment #6
intyms CreditAttribution: intyms commentedyou can use http://drupal.org/project/token_filter
together with php function:
$your_text_filtered = check_markup($your_text, $format = FILTER_FORMAT_DEFAULT, $check = TRUE);
see filter.module from "modules/filter" directory to find more information about check_markup() function.
ps. do not forget to add Token Filter to your Default Input Format.
Comment #7
TechNikh CreditAttribution: TechNikh commentedtoken_filter worked for this case
token_filter still doesn't support all tokens especially node tokens. I don't know if it can get the replacement patterns for the fields.
My use case: I have a voting widget in views field. I excluded it. Now I want to put a custom php field and show the voting widget within
if the node is published and within
if node is unpublished.
Any alternatives for my case?
Comment #8
TechNikh CreditAttribution: TechNikh commentedThis worked like a charm. http://drupal.org/node/972256#comment-4172446