Closed (won't fix)
Project:
Views (for Drupal 7)
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
19 Feb 2009 at 23:46 UTC
Updated:
10 Jul 2013 at 21:05 UTC
I am about to start writing a fluid grid style plugin, that will use CSS floats to create a variable-width grid. (Same as what I did for 5.x, basically.)
This would be for galleries in image.module -- or I could make it more generic if you'd be interested in including it.
Comments
Comment #1
michelleI don't know if it would be included but I know a lot of people would be interested in this if you could make it work well cross browser. I tried and failed to do it and ended up just using the table based grid.
Michelle
Comment #2
merlinofchaos commentedIt might be of value in the Views Bonus Pack but I am pretty happy with the default styles Views ships with.
Comment #3
markus_petrux commentedIt seems it is being implemented in image_gallery module (part of image package).
However, I also need this kind of views plugin, so it would be nice if it was something that do not depend on anything else but Views.
I have it almost done as a custom module, but if no one else is going to pack this as a separate contrib, maybe I could? Would that be of interest to someone else?
Advice appreciated. Thanks! :)
Comment #4
joachim commented> It seems it is being implemented in image_gallery module (part of image package).
Yes. I figure this either belongs in image gallery or in views. This issue wasn't moving, so I went ahead and released in in image gallery module (for now).
I don't want image galleries to depend on views + another contrib module, so really if this is to be of wider use I still think we should get it into views.
However, these issues need addressing first:
#564488: Allow users to specify gallery LI size
#575790: cross-browser support for gallery style
Comment #5
markus_petrux commentedIn regards to cross-browser support...
In regards to the LI size thing... here's how I would do it: There could be a fixed number of plugin style options for the width, with a select element, and then use CSS classes. There shouldn't be a lot of classes, just a few to offer a common set of options 150, 200, 250, 300, 400, 500, period. This could also be extended with a Drupal variable, for example:
and this can be defined in settings.php like this:
...or in real time, just before the plugin style code is invoked, like this:
Themers would still have to extend the CSS classes for addition widths, though.
I think a fluid grid plugin for Views could be reused by many other projects, not just image module.
My main problem is that I need this asap, I do not need image module, and I would prefer using something that's published at d.o. because there are a lot more chances to discover bugs than something that is just custom (ie. no one else can see the code), so if it is not included in Views, then... what?
@joachim: Earl, said not in Views, so... would you create a separate project for this Views plugin?
Comment #6
joachim commentedCross-browser support: nice! Please comment over on that issue.
LI sizes: I think a setting like that is not the right way to do it -- you'd be affecting all views with this style unless you started storing an array of view names too, which gets messy. Views handlers and plugins already have a system for storing extra settings -- we should just use that.
The patch at #564488: Allow users to specify gallery LI size could be changed to give a dropdown. I take it you'd have it apply a css class like 'item-size-300' which would then have some suitable rules in the stylesheet? That's potentially cleaner than that patch -- want to discuss it over there?
I'm not sure about creating a module just for this to live in. I don't want a long list of dependencies for image galleries.
I'm of the opinion that this has as much place in views as the Table grid display style -- possibly more as it's a better, cleaner, dare I say it semantically correct way of making a grid of stuff.
Sadly, I didn't get enough time to convince Earl of this at DrupalCon Paris as in between the food and wine and dodging weirdos with guitars, I forgot... ;)
Comment #7
markus_petrux commentedI would be happy to comment in the image issues queue, but I do not need that module, I need something that does not depend on anything but Views.
So I'm now stuck in a custom solution, unless you agree to move this plugin to a separate module. If not, then I think I prefer doing it myself rather than using custom code that no one else can take advantage of.
LI sizes: yes, my code above was just an example on how default options available could be extended, but each view would have its own chance using style plugin settings.
Comment #8
michelleI hesitate to speak for Earl, but I'm fairly sure he actually said this so hopefully am not speaking out of turn here. The problem with including it in Views is that anything in Views needs to be supported by Earl. So how about a compromise? If you pledge to answer any support requests related to this plugin and keep it up to date as needed, could it then go in Views? I, too, would like to see this in Views itself but can't promise to be the one supporting it and can sympathize with him not wanting to add more to his work load.
Michelle
Comment #9
joachim commented[cross-posted with Michelle above btw]
I think these are the ways forward here:
- we get this into Views. Earl just said on IRC that if he was sure it was castiron CSS that would never need his maintenance, he'd think about it
- it goes in views bonus module
- it goes in a new module
I don't think I should change image module at this stage -- I'm trying to get a 1.0 release FINALLY out, and there have been too many big changes already.
Likewise, getting into views, even if it happens, I'm guessing wouldn't be till the next major release, given that the high priority for Views is D7.
So if you want this now, and you want community support and development, best thing might be a new module or views bonus, as a temporary measure.
Copy everything you need from image module -- if you could contribute back your fixes and improvements that would be a big help.
Comment #10
markus_petrux commented@Michelle: I cannot imagine how can Earl deal with the whole Views and Panels monsters. It looks like he lives in a world where days have 48h or more. =:-o
@joaquim & all: I will commit (later today or tomorrow) the code I wrote to my sandbox space, and then I hope that helps to decide if it worths, or what can be done next. It is not based on the plugin in image gallery because I started to do it before looking into that. Then I realized that I would have to look a bit, because this is something that almost every image gallery might need, I thought.
Comment #11
markus_petrux commentedok, here we go:
http://cvs.drupal.org/viewvc.py/drupal/contributions/sandbox/markus_petr...
This style plugin comes with template and .css files that can be changed at will. I have also implemented plugin options to dynamically set text-align, width, height, horizontal and vertical margins and a couple of optional CSS3 properties (box-shadow and border-radius that do not work on all browsers, but they should cause no harm, I think). I tested this on Firefox 3.5, Opera 10, IE6 today. Yesterday I also tested in IE8, but I made a few changes since then, so I'm not 100% sure everything works ok in IE8, but I'll re-check this particular case next Monday. The only problem I have not been able to solve is that
ul { text-align:justify }does not work in IE6 (ignores this attribute).Please, let me know. My personal preference is to not depend on anything other than Views.
Comment #12
michelle@markus_petrux: That's my preference as well. I want to use this in Advanced Profile Kit and would rather not introduce a chain of dependencies. I already depend on Views and could add VBP if I absolutely must but depending on Image is a no go.
Michelle
Comment #13
joachim commentedI'd like this in Views too.
Clearly, it's useful for a lot more than image galleries -- video galleries, profile mugshots (I assume this is what Michelle is making with it).
I'm not enough of a CSS wiz to offer to maintain it, however.
Had a very brief look at your sandbox code.
I'm not sure about CSS options beyond the item box width and height -- I'd say if you want shadows and stuff you should be working in your own stylesheet!
Comment #14
markus_petrux commentedI added all these options to the style plugin because it is easy to adapt from Views UI, it is more Wysiwyg. But anyway, no problem, I could add this later from custom code.
In regards to margins, paddings and alignments... this could be fixed in the default stylesheet. CSS3 stuff could also be stripped out from here as well. No problem. Easy to override from custom stylesheets.
I cannot really say I would be able to deal with issue related to this plugin from the Views queue, because it is a big, big issues queue. Maybe one day, but now I do not have the time for this. I have spent a bit more than a year already in the project I'm working on, and I need to speed up a few things that are still pending.
Not sure what else I could do now. Anyone had the opportunity to test it? Does it worth to spend time writing a patch for views?
In case of doubt, I think I'll go ahead and create a separate project. It could then mature from there, and maybe one day it is stable enough and ready for Views. It doesn't matter much to me as far as a fluid grid exists for Views in a way that can be easily reused, not only for me, but everyone else that may need this kind of layouts in Views.
Comment #15
markus_petrux commentedWell, I need to start next week with more stuff in front of me still pending to solve, so I'm going ahead here and I have created a project page for this:
http://drupal.org/project/views_fluid_grid
Note that I have made a few changes to the code and added documentation in the README as well as in the project page.
Basic changes are that advanced stuff is fully optional, and the corresponding stylesheets are isolated into a separate .css file, so if someone does not like this, then don't use it, and you can style using the base .css file provided. All these .css files use a name unique to the module so one can easily override them from theme .info files, etc.
I will be more than happy to provide upgrade paths from this module to a possible implementation in Views, if that happens.
In the meantime, I hope this tiny module can help others build galleries or whatever one finds use for it.
Cheers
Comment #16
scottrigby+1 for this style plugin...
For what it's worth, I've been using http://drupal.org/project/views_fluid_grid on basekamp.com (on the events & projects pages) for a week now & no problems from what i can see. Solves something that's been nagging me... how a (fixed column number) grid display feels out of place in a fluid page layout. Thanks a lot!
Comment #17
mattyoung commented.
Comment #18
ddorian commented+1
subcribing also
Comment #19
drewish commentedsubscribing should this get bumped to 3.x?
Comment #20
merlinofchaos commentedProbably, though I'm not convinced it's something I want to put in Views in general. It could live very happily in contrib, I think.
Comment #21
scottrigbyare you sure you don't need more code to maintain Earl? ;)
Marking as fixed since Markus' module (http://drupal.org/project/views_fluid_grid) is living on it's own, and working happily with Views :D
Comment #23
klonos...sorry, having this as fixed might give people the wrong impression that this was actually implemented and that the default views module grid format is fluid when it's not.