How does Drupal 6.x Views request multiple taxonomic terms that are tied to a single piece of content?

This question is about Drupal plumbing. I know how, using the Views query builder, to display several taxonomy terms that are associated with a single piece of content. I can't figure out how Views actually queries the database to do this work.

For example, it’s easy to see that views show a list of blog posts containing one or more tags:

Title: "Brett Favre is Hurt" Body: "blah blah blah" Tags: Football, Injury Title: "Cliff Lee Signs Contract" Body: "blah, blah, blah" Tags: Baseball, Free Agency, Philadelphia 

What I cannot understand is how Views deals with pulling multiple tags and rendering them with each content element. There is no SQL query in the preview request that includes a taxonomy.

My guess is that a subquery occurs in the Taxonomy field, or the query pulls several records and somehow groups the fields in the header and body (which seems rather inefficient).

I try to follow the standard Drupal rules for the custom module, and I would like to know how Drupal Views people run these queries, as they work pretty fast.

+4
source share
1 answer

This is done in the pre_render () function with a separate request, see submission 2 of the api documentation .

When you try to understand how X's representations are made, I always try to figure out when this happens. Since they are all divided into classes in separate files (usually below the modules / module_name folder)

+1
source

Source: https://habr.com/ru/post/1332070/


All Articles