0

I want to show content of type A (products) in the middle of contents of type B(Producers), however I do not want to use Node reference since it's an overkill to make it happen with lots of products.

So far I have a Vocabulary which both content type share, so I thought if I choose a single taxonomy term when creating the contents of each type, I can relate them using views to each other based on that shared taxonomy.

Anyways so far no luck, I appreciate any helps.

1

Add a block view to show content of type A (products), add a contextual filter Content: Has taxonomy term ID, provide default value with PHP:

$node = node_load(arg(1));
return $node->field_term['und'][0]['tid'];

You can add safeguards, like is_int(arg(1)), is_object($node), $node->type == "product", etc. You don't need to if you add the block to a region and set it to be displayed on nodes of type B (producers) only.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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