Made a couple of tweaks so I could use this module to create a gallery (Media, Media-select, File_entity, Field view, Colorbox) using a content type with a multivalue image_field and a single field_view field in it. The node view of the gallery content type then shows the field_view which is hooked to the sgrid view. The sgrid view selects file entities which are filtered using a views context argument on the node id of the gallery content type. This node id context argument uses a Node relationship to bind the file entities with the gallery node. There is a single field defined in the sgrid view settings which is a Rendered file field set to display a Teaser view mode of the file entity. Thats my setup.
In order to make sgrid work with this I needed to alter a couple of things. First sgrid stores the nid or entity id but didn't take into account file_entities. I rewrote it so it takes the base_field of the base_table of the view as the 'nid' in the sgrid db table. Next I needed to seperate the view_display key in the database so i could store the different contextual agruments. So I serialized the contextual argument(s) which the sgrid view takes into a string and appended it to the 'view_display' key. So now each node gets its own order. I also modified the js and templating so that each id for the buttons and divs are distinguishable if there are more than one sgrid view on one page.
Also made the code not needing the jquery update module (only needed to replace the 'done' part in the ajax calls with the older success key. Making the module more applicable to existing instances where jquery update might give unexpected results.
... and forgot to tell that i used a query alter to add the ranking, so no need for a 'sgrid rank' filter field in the view.
Altered the css a bit, as i think this is mainly theming, so kept the css to a minimum.
Also added a auto save option, so that when you drag and release, the order is saved upon release.
It's working for me, so before deploying this on an existing server, first try it locally, as it might break things ... or not :-)
(Patched against the 1st october dev release)
| Comment | File | Size | Author |
|---|---|---|---|
| sgrid-7.x-1.x-dev-20131001-1.patch | 26.68 KB | kriboogh |
Comments
Comment #1
kriboogh commentedComment #2
Countzero commentedHi and thanks for your work on this module.
I sent you a message about becoming the maintainer. Did you receive it ?
Comment #3
chrisivens commentedIt seems that the js is very much in need of reformatting as I even did a load of it in my other patch. I think JS reformatting might need its own patch so we can all concentrate on the real issues.