Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Just upgraded after a few months
All views were broken till I did group by by the field I'd been using as tab field title, which as far as I can tell isn't being used anymore?
$sets = $this->render_grouping($this->view->result, $this->options['grouping']);
// Render each group separately and concatenate. Plugins may override this
// method if they wish some other way of handling grouping.
$output = '';
$this->view->row_index = 0;
foreach ($sets as $title => $records) {
$content = '';
if ($this->uses_row_plugin()) {
...
}
} else {
$rows = $records;
}
if (!$tabset[$title] && $this->uses_fields()) {
$tabset[$title] = array(
$title is '' for non grouped.
Comment | File | Size | Author |
---|---|---|---|
#8 | views_tabs-733978-1.patch | 4.61 KB | jdwfly |
#6 | views_tabs-733978.patch | 2.17 KB | jdwfly |
#2 | node_view_fields_title.patch | 2.14 KB | snufkin |
Comments
Comment #1
hefox CreditAttribution: hefox commentedoops
Comment #2
snufkin CreditAttribution: snufkin commentedThis fixed it for me, but use it with caution, I am not very familiar with the views API.
The issue was that title is not handled at all when using the row plugin instead of displaying nodes, moreover the content is concatenated instead of grouped under one title. Also removed the ambiguous selector option on the options, it was falling into the first if anyway because of the single '='.
Comment #3
jdwfly CreditAttribution: jdwfly commentedI am assuming you are using fields for the row style. The issue here is that the title of the tab needs to be configurable, but I was using the group by field for this purpose. And it does work in a way but it is probably not the best way to do it. That section really needs to be rewritten to include another setting that allows a person to chose which field should be the title of the tab. Someone may or may not want the title of the node as the title of the tab. I'll look into this over the next couple of days.
Comment #4
snufkin CreditAttribution: snufkin commentedI was using nodes for row style, because otherwise i could have on influence on the output (if i use rows the thumbnail slideshow doesn't use any theme overrides, so I can't inject any of my own processing there). What I wanted to achieve with my patch was to be able to use labels as the thumbnails, nothing more. The problem was that the module - as far I saw - does not implement content rendering per labels correctly if node view is used. With row style its all good though, it just didn't fit my use-case.
Comment #5
jdwfly CreditAttribution: jdwfly commentedThere are only two options for row style: node and fields. You go back and forth with different terms and it doesn't make any sense. What are you calling a label? Is that the title of the tab? You need to be more specific and use the correct terms otherwise I won't understand you.
Comment #6
jdwfly CreditAttribution: jdwfly commentedSomebody want to take this for a test drive before I commit it.
Comment #7
goldlilys CreditAttribution: goldlilys commentedTried this new patch and it still doesn't work properly as you can see here http://demo.goldlilys-media.com/singers.html . The tab label is coming from a taxonomy term which should group all singers that is tagged with that taxonomy. However, instead of grouping all singers under 1 term of same label, it creates a new tab label for each.
I tried using grouping together with the tab label for that taxonomy term, and it still doesn't work the way I want to.
Maybe you can take a look at how Views Accordion does their grouping. It should be similar to that since the only difference is the way it displays things (accordion vs tabs). As an example of the accordion and how it should group things similarly for tabs is http://demo.goldlilys-media.com/albums . Where all albums that is tagged with the taxonomy term is grouped under that in the accordion.
In views accordion, instead of having a separate "tab field", it uses the built in grouping field in Views Style options.
Hope you can fix this issue so I can start using this module when the site is live. Thanks.
Comment #8
jdwfly CreditAttribution: jdwfly commentedSo I finally got around to fixing this. Somebody want to take a look before I commit. I would suggest doing this on a test site because it will break any views you currently have. I've modified the code so that it should work as it should and I took out grouping.