I am working on a site in which we are making extensive use of skinr with a fusion subtheme.
We have some skinr classes which are used for block styling and some which are for stying specific views layouts. This bug is, of course, only related to the ones I am applying to views. When I apply these skinr classes to a views page display, everything works as expected, but when I try to apply the skinr class to a views block display, then the view output does not get the class applied. This is because the default views-view.tpl.php does not print the skinr_classes variable. I easily fixed this problem by just creating a new views-view.tpl.php and copying the code found in the views-view--page.tpl.php from fusion_core.
I am curious, why the fusion theme only contains views-view--page.tpl.php, and not views-view.tpl.php. It seems to me that if you want to be able to apply skinr styles to any type of views output, it would be best to override the default instead of the page specific tpl file.
Comments
Comment #1
stephthegeek commentedThere's a reason for this, and it's kind of complicated :)
Since a lot of Skinr styles are applied to the .inner div (to avoid breaking the grid), this needs to be present wherever Skinr styles can be applied (blocks, panels, views, etc). However, if you have a views tpl with an .inner div *and* a block tpl with an .inner div, styles end up being applied twice if you apply a Skinr style to the block that contains the view, since there are two .inners. Ditto with content pane view displays, for Panels. Thus we decided to avoid doubling of styles and confusion to only do the views page tpl, since this was the only one that wouldn't have a containing area (block, panel) that you could apply the Skinr style to.
It's mentioned briefly in our docs: http://fusiondrupalthemes.com/support/theme-developers/should-you-use-fu...
As browser support for more advanced (i.e. child/adjacent) selectors improves, we'll be able to both simplify and isolate the CSS better to work around this.
Frankly I'm surprised this question hasn't come up more often, but unfortunately it's just a little Fusion quirk we work around for now.
Comment #2
OpenChimp commentedThanks for the fast response and the pointer to the work arounds.
I actually left the .inner div out of my views-view.tpl.php file, because I suspected that it might cause problems. So far, we have not had any problems with skinr styles not applying, but that is because our custom skinr styles dont rely on it.
Glad to hear that this is a known issue. I was considering applying the skinr styles to the blocks instead of the views display, but I didn't want to clutter the block administration page with stuff that doesn't really apply, and I prefer to have all the views style settings in one place.
Comment #3
stephthegeek commentedYep that's a totally viable alternative too if you're in the "know what I'm doing" camp :) Thanks for understanding!