1

I have a taxonomy override page called taxonomy-term--listing-category.tpl.php.

As far as I'm aware I'm supposed to (as per documentation) use <?php render($content); ?> when the part in my template comes to spill all the items (teasers) associated with the taxonomy term. I'm fine with this.

Except it's empty.

Let me be clear, there are 14 items associated with this term, and they do show up, after my template in the HTML structure, as if I missed it in my template and Drupal is trying to pick up my slack.

Using Xdebug (hooked into my phpstorm) I have discovered that the $content array is 0, it's empty. None of the node items associated with the taxonomy term is available to display IN my template, they simply don't exist in any registered variable. And as such, shows up AFTER my template.

What gives?

1 Answer 1

1

I was stuck on this myself and went hunting for the answer.

From my understanding, taxonomy_term_page generates data for a page. Therefore, the $build variable outputs its content to a page template and that's why you see it after the theme template.

The $content variable in the theme template, taxonomy-term.tpl.php, should contain the description or any fields you have created for the term.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.