Hi. I am referencing to the same template from different Locations.
First example is my frontpage-view
I have a categorie-navigation-template. In this template i am referencing all nodes (template_kategorie) . And I am referencing the categorie-navigation-template in my frontpage-template whicj´h is included with views. The frontpage should display the kategorie-Nav image from the Node (template_kategorie)

And i have Quicklinks. I am referencing the Quicklinks from template_kategorie. The frontpage should display the Quicklink-Image from the node (template_kategorie).

This is my code in template_kategorie:

if ($referencing_field == "field_reference_quicklink"):
	print '<a href="' . $node_url . '">' . render($content['field_image_quicklink']) . '</a>'; 
endif;
if ($referencing_field == "field_kategorien_reference" || $referencing_field == "field_reference_kategorie2"):
	print '<li><a href="' . $node_url . '"><img src="' . file_create_url($node->field_image_kategorie['und'][0]['uri']) . '"  /></a></li>';
	
endif;
if ($referencing_field == "field_seitenleiste_reference"):
	print '<a href="' . $node_url . '"><img src="' . file_create_url($node->field_image_seitenleiste['und'][0]['uri']) . '"  /></a>'; 
endif;

Now the following happens: when I reference the same node from my categorie-navigation-template and in my Frontpage-Template the referencing_field value is wrong .

I am doing the same in my kategorie-template. I´m referencing the categorie-navigation-template which -of course- references to the node, the nav is displayed. When I do this, the categorie-navigation displays only a linked title to the node i´m viewing. 2nd is, I have also Quicklinks in my kategorie-template. And when I´m referencing for example to node 1 and 2, the references of my categorie-navigation are displaying the Quicklinks 1 and 2 instead of the kategorie-navigation-Picture.
This is driving me crazy. Sometimes it worked, when I switch the positions of the references in my categorie-navigation-template. But only as a temporarly effect.

It would be SO nice to get help, I´m googling and trying for days now.

Thx, Lars

CommentFileSizeAuthor
DarstellungDrupalcenter.pdf35.86 KBSynflag
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Chris Matthews’s picture

Version: 7.x-2.0-beta3 » 7.x-2.x-dev