2

Is there a way to use grouping settings for Bootstrap Tabs in Views?

  • I believe there are issues with the Views Bootstrap module when it comes to grouping. Be sure to check this thread: drupal.org/node/2058399, and see if the dev-version of the module helps you out. – cptstarling Jun 10 '15 at 8:38
1

There isn't a way at the moment to use the built in views group by function, but luckily there is a way to accomplish similar behavior if you install a contrib module called views field view.

https://www.drupal.org/project/views_field_view

The premise being, tabs separate a listing of entities into multiple groups based on a common term.

Not like this: https://monosnap.com/file/K4W6m63A1jsy7frYdL8P0LfcFQPj29

But like this: https://monosnap.com/file/Q8WsRSgJU7f8AYFMMomDmcIjyOAXZE

In order to make this work, you need two views, One with the tab output, and another contextually filtered as a field within the first.

View 1 (list of taxonomy terms) would look like this to create the labels for the tabs: https://monosnap.com/file/h3fDlfgy2HwlHT2Y3Lywe8IroagDyE

View 2 (Use a relationship to call the nodes that are referencing each term and a contexual filter to limit the nodes per term id): The view field here is the key: https://monosnap.com/file/NtIumKYmsws62o4kTAnU72mt1LPZZq

Once you have the two views you can set the argument on view 1 The view field here is the key: https://monosnap.com/file/EzgRlcjLgr0au7TIWnTLbWEosCHwcP

  • 1
    This worked perfectly. As an aside for anyone else looking at this. View 1 is not supposed to have that relationship. My hunch is that Chris forgot to override the second block when creating this example. Also, when adding the view field (3rd step), you want to select your View 2 display mode (Give them unique names to avoid confusion). And lastly to note: If you make a bunch of changes on the secondary view that will display through the view field, you need to save the entire view for it to reflect in the field. Quirky quirks! – Antonio Torres Nov 30 '16 at 0:15
0

Unfortunately my reputation is too low to comment on Chris' answer; however, there is one important piece missing that took me awhile to figure out is that in order to have your tabs show only the unique taxonomy terms as shown in his "not like this / but like this" photos, you'll need to set "Use aggregation" on the "View 1" view to Yes.

Also, I have to disagree with Antonio's comment - I did find that the Relationship (which in Drupal 7.63 is called "Content: Taxonomy terms on node") was necessary on both views.

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.