V
V
Vadim Timoshenko2016-03-23 17:20:39
Drupal
Vadim Timoshenko, 2016-03-23 17:20:39

Why does drupal swear at the output of variables in the template?

Installed the Print Email and PDF module.
I display in the actually created print.tpl.php file (in the theme folder) the node fields with the following code:

<?php print $node->field_estate_type[LANGUAGE_NONE][0]['taxonomy_term']->name; ?>

But cms starts to display errors like: Undefined index: taxonomy_term in the include() function in the print.tpl.php file exactly on this line in the include() function.
What is the reason for the error? Am I displaying the fields incorrectly? Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vadim Timoshenko, 2016-03-23
@PbI6A_KuT

https://habrahabr.ru/post/163501/
this article will probably help me.

T
Tlito, 2016-04-03
@tlito

install the Devel module and write the code:
<?php dpm($node->field_estate_type[LANGUAGE_NONE][0]); ?>
to see what elements are in this array. perhaps there is no taxonomy_term element

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question