On a site which runs with a subtheme of Omega 6, I built a View which uses a grouping field to show something like that:
Section A
data 1
data 2

Section B
data 3
data 4

But the result is:
Section A
data 1

Section A
data 2

Section B
data 3 (and so on)

As in the issue http://drupal.org/node/1028154, I first suspected Views itself to cause the problem, but than I noticed that the error occurs only using the Omega Theme:

  • When I visit the Views live preview (which uses the administration theme), everything is fine.
  • With *any* other theme of the site, the view renders fine, too.
  • Only with Omega Theme, Omega Starter Kit and my own Omega subtheme, it doesn't show a grouped view but all data as shown in the result above.

As I like Omega very much, I'm very interested to find a solution. Please tell me, when you need more information, or something like a View export.

Comments

I am using Omega for D6 and also have a View doing a group by, however, my View renders as expected. Do you have any tpl.phps that you added to your theme or any preprocess code that could be causing this? If you look at the code for Omega, you will notice that Views is never mentioned, so I suspect that this is a quirk with Views or your implementation. Can you provide us more information, like screenshots of some of your Views configuration boxes?

Thank you very much for your comment! Indeed, finding at a quick glance no Views related files in the theme, in the beginning I didn't suspect the theme to cause the described problem. But then I saw that with any other theme my view was rendered corrctly. However, to answer your first question: I didn't add tpl.phps or preprocess code to any of the Omega (sub) themes.

I will attach some screenshots to show you the configuration of my View and the rendering in different situations. The site is in german, but I translated the main content elements or headers to english, hopefully understandable. The goal of the View is to show one issue of a books review magazine (argument = number of the issue). In each book reviews issue there are some books which should be grouped by sections (title and section intro text, in my configuration the records come from a different content type via node reference field).

As you see in the first screenshot (file name 1-view-etc.png), the rendering of the Views live preview is fine. The second screenshot shows the rendering in my Omega theme, and there is no grouping.

Trying around a bit, I discovered that the question seems to be more complex: In the 1st and 2nd screenshot, the format of the 'grouping' node reference field was set to "Format: Full node", with the results mentioned above. Then I tried the setting "Format: Title", and with this configuration the grouping worked with Omega as well (see 3rd screenshot). Unfortunately I need the full node, so the problem is not solved.

Strangely, it remains, that grouping by a node reference field (Format: Full node) is working with any theme but Omega. Being no developer, I'm not sure which other Drupal components could cause the described behaviour. If you guess, I should look to another component than Omega, any hint is appreciated. Or, if you want to test my configuration, I'll be happy to attach or send you the relevant exported view and content types.

My best guess on this one is that it is an issue with combination between semantic views, node reference, and potentially something in omega?!

I guess (the screenshots don't give too much data) it would be good if you could post a txt file here attached with your view, and content type if possible....

If this is semi-sensitive and you don't want it posted here, you can also email it to me directly. (I'll supply email if you need it, or you can hit me up via the contact form)

Just not sure where to dig into this... if this were the D7 version, I'd have a pretty good idea of what might be causing it, but the D6 version is quite sparse in functionality, so I'm just not sure yet. Will be best if I can test the same config (view, content type, etc.)

StatusFileSize
new3.98 KB

Thank you very much for the disposition to test the configuration. I cleaned it up and translated the main elements to English for better understanding. You find the view and the two relevant content types as a zipped attachment to this post.

Btw, as I tested the configuration already with other view styles, I guess the problem is not caused by Semantic Views.

In addition to my last post:
* To get a test result as a page, I used the "Issue number" of the book reviews magazine (e.g. Issue 1 as a views argument, leading to an URL like www.yoursite.net/bookreviews/1.
* I attach a screenshot of the correct result in a non Omega theme (in this case: Seven).

Title:Views Grouping field repeats only in Omega ThemeUndefined variable: default_container_width in include() (line 16 of page.tpl.php
Version:6.x-1.0» 7.x-2.0-alpha1
Assigned:Unassigned» Anand Parmar

Hi

I am getting following error when I set my subtheme as default.
Skip to main content
* Notice: Undefined variable: default_container_width in include() (line 16 of C:\wamp\www\sites\all\themes\modscooters\templates\page.tpl.php).
* Notice: Undefined variable: default_container_width in include() (line 17 of C:\wamp\www\sites\all\themes\modscooters\templates\page.tpl.php).
* Notice: Undefined variable: default_container_width in include() (line 25 of C:\wamp\www\sites\all\themes\modscooters\templates\page.tpl.php).
* Notice: Undefined variable: default_container_width in include() (line 26 of C:\wamp\www\sites\all\themes\modscooters\templates\page.tpl.php).
* Notice: Undefined variable: content_zone in include() (line 32 of C:\wamp\www\sites\all\themes\modscooters\templates\page.tpl.php).

Hello andy.parma, why did you change the title and Omega version of this issue? I don't see any reference to the questions discussed above, and I guess you better open a new issue for your topic, right?

Title:Undefined variable: default_container_width in include() (line 16 of page.tpl.phpViews grouping field doesn't work with Omega 6
Version:7.x-2.0-alpha1» 6.x-1.0
Assigned:Anand Parmar» Unassigned

Hello again Andy, I resetted know the title and Omega version of this issue. Never mind, and open a new one, if needed.

Status:Active» Closed (cannot reproduce)

Do you have the theme developer module enabled by any chance?

I had a similar issue with views grouping and devel_themer:
http://drupal.org/node/1102766

Disabling devel_themer will solve the problem.

Thanks for your hint, afehr. I have no theme developer module enabled, so disabling it will not solve the issue for me, but I found a workaround:

In my case, the requirement was to group not only by one but two content elements who act as a single one, and by elements of a different content type than the other fields used in the view. Instead of using the node reference field to this end (which didn't work with Omega), I solved the problem creating a relation to the different content type. Then I assigned the relation to both of the relevant grouping fields. Finally, i had to combine the output of the two fields in such a way, that they would act as a single output for grouping purposes. To do that, I loaded both fields, but in the configuration of the 2nd, I overwrote the output of this single field with the content of both fields. Confusing? Indeed, but it works!