You are hereViews

Views


Views, passing argument from node taxonomy term

This code will be often used if you want to pass current node taxonomy term to view to list some other nodes, for example to have a list of similar nodes, nodes with same term. Choose taxonomy term:ID and write thise code down. We load current nodes data and get term ID from key of term.

$node=node_load(arg(1));
$argum=key($node->taxonomy);
return $argum;

Custom field available data - Views

To find out which fields are available in custom fields in views, put following code in custom PHP field.

print var_export($data, false);

Views and Global:Null argument

Today I made a view from which 3 menu links derive, problem was that all had the same title as it was only one view. Way to solve this was to pass argument to view trough Global that would be ignored in query. So i made it www.mywebsite.com/view/Sport/32+31+30 so Sport is used for title then and those other numbers are passed to second argument to make query. To top all that i made URL alias to make it look nice and clean, so i made www.mywebsite.com/view/Sport/32+31+30 into www.mywebsite.com/sport.