Posted by Amitaibu on April 24, 2010 at 5:14pm
| Project: | NineSixty (960 Grid System) |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Issue Summary
Patch adds a file one should copy and rename. Here's the explanation from the docs:
+/**
+ * Set the grid of each field. We don't key the array field name (e.g. nid,
+ * title, etc') in order to allow changing the fields or their order in the
+ * Views without harming the theme override.
+ * In order for this theme override to affect your Views you should copy it and
+ * rename it the the file name as suggested by Views.
+ *
+ * The following example assumes we have a total grid of 8, and we want to place
+ * the fields next to each other:
+ * @code
+ * $row_wrapper = 'grid-8';
+ *
+ * $ids = array(
+ * '0' => 'grid-4 alpha',
+ * '1' => 'grid-2',
+ * '2' => 'grid-2 omega',
+ * );
+ * @endcode
+ *
+ * Above code will result in this structure:
+ *
+ * +--------------------------8--------------------------+
+ * +-------------------------+ +-----------+ +-----------+
+ * | | | | | |
+ * | 4 | | 2 | | 2 |
+ * | | | | | |
+ * +-------------------------+ +-----------+ +-----------+
+ *
+ * In order to group fields together under the same grid definition is done by
+ * specifying and empty value.
+ *
+ * @code
+ * $row_wrapper = 'grid-8';
+ *
+ * $ids = array(
+ * '0' => 'grid-6 alpha',
+ * '1' => 'grid-2 omega',
+ * '2' => '',
+ * );
+ * @endcode
+ *
+ * Above code will result in this structure:
+ *
+ * +--------------------------8--------------------------+
+ * +---------------------------------------+ +-----------+
+ * | | | |
+ * | | | 2 |
+ * | | | |
+ * | 6 | +-----------+
+ * | | +-----------+
+ * | | | |
+ * | | | 2 |
+ * | | | |
+ * +---------------------------------------+ +-----------+
+ */
Comments
#1
Could you possibly help provide a little more explanation about where we should paste this code?
I think maybe it goes into one of the custom views templates, but not sure which or what the proper syntax would be.
Thank you
#2
@rob_dean,
You should copy the file and rename it according to the template suggestion of Views (Theme > Row style).
#3
oh man, I forgot to add the file! :/
#4
A bit better docs on $row-wrapper.
#5
A bit better version, logic is getting a little bit more complicated, as we want to make sure no extra div is printed if there are more Views elements then the ones defined in the tpl file.
#6
hi,
This is a great help. Also, I would like to ask how we can extend the same logic to fields in Drupal 7. That is if we want to configure a content type display in 960 grid how we can group those field under specific grids.
thanks,
Perry.