Active
Project:
Views Custom Field
Version:
6.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
27 Oct 2009 at 18:04 UTC
Updated:
30 Mar 2011 at 15:34 UTC
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 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 commentedsubscribing
Comment #3
harking commentedSubscribing
Comment #4
John Bryan commentedsubscribing
Comment #5
Isostar commentedSubscribing
Comment #6
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 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 commentedThis worked like a charm. http://drupal.org/node/972256#comment-4172446