Hi all, I need to create some views (I know how to make it) but I have a questions about performance (and maintenance). All my views need to create some little piece of HTML with title, image (imagecached), little description, link to the node. All this "fields" will be contained in a <div class="mystyle_for_this_div"></div>.
We know that view's "Row Styles" can be "Fields" or "Node". In a case like this one is better to use fields or node ? If I choose "Fields" I may create one {template}.tpl.php file for each "fields" (title will be in a <h1>, little description will be in a <p>, etc etc). If I choose "Node" I may create only one node-view-MYVIEWNAME.tpl.php that include the HTML tags that I need.
I think that in this case the better solution is node-view file. Is this correct ?
Tnx.
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.
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.
With a fields-based row style, most fields (although not all) can be gotten in a single query for the view itself. (The body or teaser fields still do a node load, which is why I never use them, and if you have a CCK field that is "group multiple values" then it's one extra query per row.) You also can theme that individual row or the whole view or individual fields however you want (although generally you can do most things you want in CSS).
I've occasionally used teaser views when I had do something totally nutty, like embed a view within each record of a view. I don't think I've ever done a full node view. Fields all the way for me, as I can get nearly everything I want in a single query and be done with it.
On Wednesday 07 October 2009 2:41:02 am Michel Morelli wrote:
Hi all, I need to create some views (I know how to make it) but I have a questions about performance (and maintenance). All my views need to create some little piece of HTML with title, image (imagecached), little description, link to the node. All this "fields" will be contained in a
<div class="mystyle_for_this_div"></div>.
We know that view's "Row Styles" can be "Fields" or "Node". In a case like this one is better to use fields or node ? If I choose "Fields" I may create one {template}.tpl.php file for each "fields" (title will be in a <h1>, little description will be in a <p>, etc etc). If I choose "Node" I may create only one node-view-MYVIEWNAME.tpl.php that include the HTML tags that I need.
I think that in this case the better solution is node-view file. Is this correct ?
Tnx.
Hi,
I've written a small module for a site I'm working on.
What it does: open a mailbox trought imap (with mail_api), list headers and permitted users can publish a mail as node mapping the title, the body and the attachments as file upload, taking care of mail forwarding (sometime fails, giving a blank body). The sender mail get mapped to the relative user (or the user can be created directly within the module). The publish date maps to the date the mail get recived.
The user has a populated node form (based on the type one choose, by default story) that can modify as wanted and then publish as a normal node. [Only Drupal 6 is supported.]
ok, that's all.
I would like to know if this could be useful to anyone and if it could be listed in the drupal.org cvs. Maybe interested and more skilled contributors/users could help to make it grow better than what I can do by my own.
But .. is this a duplicate? What about security? Any hint?
Thank you. Best Regards, Luca
It seems useful, but, Only a question... What are the differences between your module and mailhandler or listhandler?
----- Original Message ----- From: "luca capra" luca.capra@gmail.com To: support@drupal.org Sent: Thursday, October 08, 2009 9:37 AM Subject: [support] A module for email publishing
Hi,
I've written a small module for a site I'm working on.
What it does: open a mailbox trought imap (with mail_api), list headers and permitted users can publish a mail as node mapping the title, the body and the attachments as file upload, taking care of mail forwarding (sometime fails, giving a blank body). The sender mail get mapped to the relative user (or the user can be created directly within the module). The publish date maps to the date the mail get recived.
The user has a populated node form (based on the type one choose, by default story) that can modify as wanted and then publish as a normal node. [Only Drupal 6 is supported.]
ok, that's all.
I would like to know if this could be useful to anyone and if it could be listed in the drupal.org cvs. Maybe interested and more skilled contributors/users could help to make it grow better than what I can do by my own.
But .. is this a duplicate? What about security? Any hint?
Thank you. Best Regards, Luca
-- [ Drupal support list | http://lists.drupal.org/ ]
I must try these modules, seems really good..
mine it's similar.. but simpler the module read mails from imap as a client, the user choose which ones to publish and get a prepopulated node form to edit and submit as could do in node/add.
Simone Dal Maso ha scritto:
It seems useful, but, Only a question... What are the differences between your module and mailhandler or listhandler?
----- Original Message ----- From: "luca capra" luca.capra@gmail.com To: support@drupal.org Sent: Thursday, October 08, 2009 9:37 AM Subject: [support] A module for email publishing
Hi,
I've written a small module for a site I'm working on.
What it does: open a mailbox trought imap (with mail_api), list headers and permitted users can publish a mail as node mapping the title, the body and the attachments as file upload, taking care of mail forwarding (sometime fails, giving a blank body). The sender mail get mapped to the relative user (or the user can be created directly within the module). The publish date maps to the date the mail get recived.
The user has a populated node form (based on the type one choose, by default story) that can modify as wanted and then publish as a normal node. [Only Drupal 6 is supported.]
ok, that's all.
I would like to know if this could be useful to anyone and if it could be listed in the drupal.org cvs. Maybe interested and more skilled contributors/users could help to make it grow better than what I can do by my own.
But .. is this a duplicate? What about security? Any hint?
Thank you. Best Regards, Luca
-- [ Drupal support list | http://lists.drupal.org/ ]
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.
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.