0

I have a Content type which has Term reference type of fields called Tags and Categories and a default field like Body (Long text and summary).

What I want to be able to do if possible is to have a View display these fields such that when this Content type is viewed, Tags and Categories are brought up by a View which will list the values in that field specific to that node, and any other field will be brought up the default way (through Manage Displays).

I figured that since that Tags and Categories are fields I didn't want to be visible, I set them to Hidden in Manage Display. So at least this part is done.

As for making Categories and Tags appear as a View in a Block, is it possible to do this by using Views Relationships and Contextual Filters? If so, how?

Here's a little graphic to help you visualize what I'm trying to do"

https://i.sstatic.net/PJ4Tm.png

Any help is appreciated. Thanks in advance!

1 Answer 1

0

There are a couple of ways to this using Views. Chances are that you will have to visit the display settings of the content type to hide its content so that it does not show duplicated.

Solution 1. Create a block for each section of the page you want to relocate using Views using the argument or contextual filter so that the block use the node ID to show the right content in the right page. Then enable the blocks and make them visible by content type and you can play with the position of the block using CSS and/or the module block class.

Solution 2. Use the module EVA that it will let you create an view attachment to the node content type entity and that you can re-arrange like any other field in the content type display settings screen. The rest of the setup is similar to the way you created the blocks in solution 1.

Solution 3. You don't need to use views at all, just CSS and you are good. Reposition the fields using the content type display manager make the tags field first, then the body and last the category. Since each field will have a wrap div then use a simple "float", "with" and "margin" css to accomodate the content.

CSS Example (classes are not real)

.div-wrap-for-tags {float:left;margin-right:20px;width:200px;}
.div-wrap-for-body {float:left;width:400px;}
.div-wrap-for-category {clear:both;}
1
  • Thanks, redhatlab. I went with Solution 1 since this is what I was originally aiming for. I just want to add a small caveat with this approach. For some reason, I couldn't get the blocks containing my taxonomies (Tags and Categories in this example) to show with my custom content type until I checked the box called Exclude in my Views -> Advanced -> Configure Textual Filters (filter is node id).
    – johnmiste
    Commented Apr 29, 2013 at 17:18

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.