I have a view with fields, where $row->type is a node type. When trying

<?php
print variable_get('comment_default_per_page'.$row->type);
?>

getting nothing

What is the correct way of using variable_get() to extract variables? Other function?

Comments

dieuwe’s picture

I was a little stuck on this too for a while, but try this in the field value code:

return variable_get('my_variable' , NULL);

(Without the PHP tags)


And then this for the output code:

print $value

That worked for me.

Liam Morland’s picture

Issue summary: View changes
Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.