0

I want to create a simple websites listing. I have created a content type named Sites and a taxonomy vocab named Sites to handle Sites nodes categorization. i.e every Site node (a content of type Sites) belongs to one term under Sites taxonomy vocab.

In the Views module, I have created a new Page view which has the path /sites-cats-listing and it shows Taxonomy terms of type Sites. The format is Unformatted list and it is only has one field Taxonomy term: Name

It renders a simple list of Taxonomy vocab Sites terms as expected. However, I want to list all of sites titles that belongs to each taxonomy term, so, I will get two levels list something like the following example:

-term1
--Site1
--Site2
--Site3
-term2
--Site4
--SiteA
etc... 

Also I need to be able to rewrite the site's title field to make it linked directly to the destination website.

So, I need to know is there any way to attach a block to field which the block takes its contextual filter from the field value? Or is there any other workaround to complete this task? I have tried EVA but I could not able to find what I want to get.

1
  • When editing your view, look for the word SORT, next to it, click on add a field. Search for taxonomy term and click add. I think that should take care of your "Two level" list. – No Sssweat Sep 9 '15 at 23:40
1

this can be done with a bit of code in a tpl file or in a preprocess function.

Views has a function views_embed_view that you could use to embed the block into your field output.

print views_embed_view('views_name', 'display_id', $fieldvalue);

https://www.drupal.org/node/1336844

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.