[support] Views: is better node or fields for the "Row styles" ?
luca capra
luca.capra at gmail.com
Thu Oct 8 09:13:48 UTC 2009
you should find the data you need in the $field / $row variables.
with devel enabled try out this in the field template file
<?php krumo( $field->field_values[$row->{$field->field_alias}] ); ?>
or
<?php krumo( get_defined_vars() ); ?>
Michel Morelli ha scritto:
> Larry Garfield ha scritto:
>
>> Actually, I virtually never use "node" rows. A node row does a full node load
>> for every node that gets loaded. A full node load could mean anywhere from
>> 5-15 queries depending on what modules you have installed... *per node*.
>> That's in addition to the query of the view itself. You can easily burn 100
>> queries that way.
>>
>>
> Ok, but why the VIEW extract the "node" that corrispond to my "request"
> via a "SELECT DISTINCT node.nid" ?
> I have analyzed the query via hook_views_pre_executed().
>
>> You also then cannot effectively theme the node rows separately from their
>> normal "page at node/X" and teaser versions. It uses the same theming.
>>
>>
> No. For the "node" row I can use node-view-MYVIEWNAME.tpl.php so I can
> use a template file only for the result of the view.
>
>
>> With a fields-based row style, most fields (although not all) can be gotten in a
>> single query for the view itself.
>>
> Ok, but how to recreate (via fields row) a structure like this:
>
> <a href="#NODE/NID#">
> <img src=#IMG#>
> #TITLE#
> </a>
>
> With "node" rows I use a node-view-MYVIEWNAME.tpl.php and I have what I
> want.
>
>
>
More information about the support
mailing list