You are here

README.txt in GridStack 8

ABOUT
GridStack provides provides integration with gridstack.js as a dynamic layout
builder for both magazine layout, and static float grid layout like Bootstrap,
or Foundation, with drag-and-drop. A few optional field formatters, and Views
style plugin.
See https://troolee.github.io/gridstack.js/,
or https://github.com/troolee/gridstack.js


REQUIREMENTS
- Blazy module
- GridStack library:
  o Download GridStack from https://github.com/gridstack/gridstack.js/releases
  o Extract it as is, rename it to "gridstack", so the assets are available at:

    /libraries/gridstack/dist/gridstack.min.js (required by js-driven front-end)
    /libraries/gridstack/dist/gridstack.all.js (required by admin UI)

Note:
GridStack 8.x-1.0-beta4 below requires v0.2.5.
GridStack 8.x-1.0-beta5+ and DEV versions require a minimum v0.4.0.

FEATURES
o Supports magazine layouts, identified by fixed heights.
o Supports static float layouts for Bootstrap, or Foundation, identified by
  auto heights. With Bootstrap 4 flexbox grid, limited magazine layout is
  possible with little CSS overrides.
o Supports optional core Field Layout, Layout Builder, DS, Panelizer, Widget
  modules.
o Responsive grid displays, layout composition, image styles, or multiple unique
  image styles per grid/box.
o Drag and drop layout builder.
o Lazyloaded inline images, or CSS background images with multi-styled images.
o Field formatters for Image, and fieldable entities like File Entity Reference,
  and optional Media Entity and Paragraphs integration. Specific to fieldable
  entities, best when containing core image using Blazy formatters with CSS
  background option enabled. Requires Blazy post Beta5+, optional.
o Optional Views style plugin.
o Optional supports for Colorbox, Photobox, and Blazy Photoswip, or when using
  Blazy Views fields, or Blazy-related formatters from within Views.
o Modular and extensible skins.
o Easy captioning.
o A few simple box layouts.


INSTALLATION
Install the module as usual, more info can be found on:
https://www.drupal.org/docs/8/extending-drupal-8/installing-drupal-8-modules


USAGE / CONFIGURATION
As Views style plugin:
o Visit admin/structure/gridstack to build a GridStack.
o Visit admin/structure/views, and create a new page or block with GridStack
  style, and assign the designated optionset.
o Use the provided sample to begin with, be sure to read its README.txt.

As field formatters:
o Go to "Manage display" page, e.g.:
  admin/structure/types/manage/page/display

o Find "GridStack" formatters under "Manage display" for supported fields:
  Image, File entity reference, Media Entity, Paragraphs.
  With complex fields like Media Entity or Paragraphs, you can combine GridStack
  formatters with Slick formatters to build unique grid layout for the slider.

As Bootstrap/ Foundation layouts:
This requires any of _optional core Field Layout, Layout Builder, DS, Panelizer,
or Widget modules to function.
Please refer to their documentation for better words.

o Visit GridStack UI to enable the static grid support:
  /admin/structure/gridstack/ui

  Choose either Bootstrap, or Foundation under "Grid framework".
  Only one grid framework can exist globally.
  Be sure to fill out the required Grid library to make it work with core Layout
  Builder. It won't be loaded at front-end, only needed at admin pages, so be
  sure you have a theme, or module, which loads it at front-end.

o Visit GridStack optionset collection page:
  /admin/structure/gridstack

  - Create, or clone existing "Default Bootstrap", or "Default Foundation".
    The required option: "Use static Grid Bootstrap/Foundation framework".
    Disabled once saved to avoid issues.
  - Build a static grid layout with floating boxes in mind, say "Boostrap Hero".
    If a grid breaks, try putting them as nested grids within their own rows.
  - Leave "xl width" option empty if not desired, such as for Bootstrap 3.
    The "XL" grid class is only available at Bootstrap 4.
  - Clone existing optionsets to reduce steps.

o Clear cache whenever updating/ editing existing layouts.
  - Don't always do this when all needed layouts are in place.

o Assign the newly created layouts at any UI for Field, DS, Panels, Panelizer,
  Widget:
  /admin/structure/types/manage/article/display
  /admin/structure/panelizer/edit/node__article__default__default/layout?js=nojs
  /admin/structure/block
  - Put relevant contents to each GridStack region.


SIMILAR MODULES
http://dgo.to/mason
Both try to solve one problem: empty gaps within a compact grid layout.
Mason uses auto Fillers, or manual Promoted, options to fill in empty gaps.
GridStack uses manual drag and drop layout builder to fill in empty gaps.


ROADMAP
[x] Support multi-styled images to have various sizes, only if doable. Currently
    using CSS background images to solve sizes.
    2/29/16
[x] Multi-breakpoint responsive grid layouts.
    3/11/16
[x] Multi-breakpoint image styles.
    3/14/16
[x] Supports lightbox boxes.
    12/14/16 for Field formatter, or use Blazy for Views images.
[x] Decouple from Views to make GridStack a more generic layout builder.
    2/27/2017
[x] Optional integration with core layout_discovery (core >= 8.x-3) and
    layout_plugin (core < 8.x-3) so that gridstack layouts are exposed to DS,
    Panelizer, Panels, etc.
    3/22/2017
[x] Supports Bootstrap 4 for XL breakpoint.
    3/29/2017
o Use Vanilla JS for frontend.

The following may likely happen by some personal project, or sponsorship.
[x] Field formatter
    12/14/16
[x] Multimedia boxes.
    12/14/16
[x] A generic layout builder for Bootstrap, or Foundation.
    3/22/2017
o Field widget.
o Stamps.
o D7 port.

Feel free to get in touch if you'd like to chip in, or sponsor any. Thanks.


TROUBLESHOOTING
o Be sure the amount of Views results are matching the amount of the grid boxes.
o Follow the natural order keyed by index if trouble with multiple breakpoint
  image styles.
o Clear cache when updating cached Gridstack otherwise no changes are visible
  immediately. You can also disable the Gridstack cache during work.

Below are valid for v0.2.5 below:
o At admin UI, some grid/box may be accidentally hidden at smaller width. If
  that happens, try giving column and width to large value first to bring
  them back into the viewport. And when they are composed, re-adjust them.
  Or hit Clear, Load Grid, Save & Continue buttons to do the reset.
  At any rate saving the form as is with the mess can have them in place till
  further refinement.
o Use the resizable handlers to snap to grid if box dragging doesn't snap.
  Be gentle with it to avoid abrupt mess.
o If trouble at frontend till gridstack library is decoupled from jQuery UI or
  at least till jQuery related issues resolved, for its static grid, check the
  option "Load jQuery UI". If you are a JS guy, you know where the problem is.
  A temporary hacky solution is also available:
  /admin/structure/gridstack/ui


TIPS
To have re-usable different image styles at multiple breakpoints, create them
once based on grid dimensions to easily match them based on the given dimension
hintings, e.g.:
o Box 1x1
o Box 1x2
o Box 2x1
o etc.

Enable GridStack UI and visit "/admin/structure/gridstack" and edit
your working optionset to assign different image styles for each box of the
GridStack. Then you can match those image styles with the provided dimension
hints easily -- 2x2 for Box 2x2, etc. Try giving fair sizes so that they fit
well and have no artifacts at multiple breakpoints.

Or use more simplified image styles like below:
o Box square
o Box tall
o Box tower
o Box wide
o Box panorama

And assign the largest dimensions to avoid artifact.
With "Use CSS background" option enabled, those sizes don't matter much.

Use Blazy formatters to have Colorbox/Photobox/Photoswipe supports.


CURRENT DEVELOPMENT STATUS
A full release should be reasonable after proper feedbacks from the community,
some code cleanup, and optimization where needed. Patches are very much welcome.

Alpha and Beta releases are for developers only. Be aware of possible breakage.

However if it is broken, unless an update is explicitly required, clearing cache
should fix most issues during DEV phases. Prior to any update, open:
/admin/config/development/performance

Re-generate CSS and JS assets, and hit "Clear all caches" button.


KNOWN ISSUES
o Having the exact amount of items to match the optionset grids is a must.
o If you have more items than designated optionset grids, the surplus will not
  be displayed as otherwise broken grid anyway.
o If you have less items, the GridStack will not auto-fix it for you.
  Simply providing the exact amount of items should make it gapless grid again.
o Not compatible with Responsive image OOTB. GridStack has its own managed
  multi-styled images per breakpoint.
o Nested grids are only supported by static grid Bootstrap/ Foundation, not JS.


AUTHOR/MAINTAINER/CREDITS
gausarts

Contributors:
https://www.drupal.org/node/2672858/committers

THIRD PARTY MATERIALS
gridstack.js

The version of gridstack.js included in this project is a derived from
gridstack.js 0.3.0-dev
http://troolee.github.io/gridstack.js/
(c) 2014-2016 Pavel Reznikov, Dylan Weiss.
It was licensed under the MIT license.

It has been modified by Gaus Surahman to work with Drupal.
The modified version removed deprecated methods worth ~20Kb minified (half),
suitable only for static grid option as normally seen at static frontend.

gridstack.css

The version of gridstack.css included in this project is a derived from
gridstack.css 0.3.0-dev
http://troolee.github.io/gridstack.js/
(c) 2014-2016 Pavel Reznikov, Dylan Weiss.
It was licensed under the MIT license.

It has been modified by Gaus Surahman to work with Drupal.
The modified version provided modularity which is not accommodated by
the original file.


READ MORE
See the project page on drupal.org: http://drupal.org/project/gridstack

See the GridStack JS docs at:
o https://github.com/troolee/gridstack.js
o http://troolee.github.io/gridstack.js/

File

README.txt
View source
  1. ABOUT
  2. GridStack provides provides integration with gridstack.js as a dynamic layout
  3. builder for both magazine layout, and static float grid layout like Bootstrap,
  4. or Foundation, with drag-and-drop. A few optional field formatters, and Views
  5. style plugin.
  6. See https://troolee.github.io/gridstack.js/,
  7. or https://github.com/troolee/gridstack.js
  8. REQUIREMENTS
  9. - Blazy module
  10. - GridStack library:
  11. o Download GridStack from https://github.com/gridstack/gridstack.js/releases
  12. o Extract it as is, rename it to "gridstack", so the assets are available at:
  13. /libraries/gridstack/dist/gridstack.min.js (required by js-driven front-end)
  14. /libraries/gridstack/dist/gridstack.all.js (required by admin UI)
  15. Note:
  16. GridStack 8.x-1.0-beta4 below requires v0.2.5.
  17. GridStack 8.x-1.0-beta5+ and DEV versions require a minimum v0.4.0.
  18. FEATURES
  19. o Supports magazine layouts, identified by fixed heights.
  20. o Supports static float layouts for Bootstrap, or Foundation, identified by
  21. auto heights. With Bootstrap 4 flexbox grid, limited magazine layout is
  22. possible with little CSS overrides.
  23. o Supports optional core Field Layout, Layout Builder, DS, Panelizer, Widget
  24. modules.
  25. o Responsive grid displays, layout composition, image styles, or multiple unique
  26. image styles per grid/box.
  27. o Drag and drop layout builder.
  28. o Lazyloaded inline images, or CSS background images with multi-styled images.
  29. o Field formatters for Image, and fieldable entities like File Entity Reference,
  30. and optional Media Entity and Paragraphs integration. Specific to fieldable
  31. entities, best when containing core image using Blazy formatters with CSS
  32. background option enabled. Requires Blazy post Beta5+, optional.
  33. o Optional Views style plugin.
  34. o Optional supports for Colorbox, Photobox, and Blazy Photoswip, or when using
  35. Blazy Views fields, or Blazy-related formatters from within Views.
  36. o Modular and extensible skins.
  37. o Easy captioning.
  38. o A few simple box layouts.
  39. INSTALLATION
  40. Install the module as usual, more info can be found on:
  41. https://www.drupal.org/docs/8/extending-drupal-8/installing-drupal-8-modules
  42. USAGE / CONFIGURATION
  43. As Views style plugin:
  44. o Visit admin/structure/gridstack to build a GridStack.
  45. o Visit admin/structure/views, and create a new page or block with GridStack
  46. style, and assign the designated optionset.
  47. o Use the provided sample to begin with, be sure to read its README.txt.
  48. As field formatters:
  49. o Go to "Manage display" page, e.g.:
  50. admin/structure/types/manage/page/display
  51. o Find "GridStack" formatters under "Manage display" for supported fields:
  52. Image, File entity reference, Media Entity, Paragraphs.
  53. With complex fields like Media Entity or Paragraphs, you can combine GridStack
  54. formatters with Slick formatters to build unique grid layout for the slider.
  55. As Bootstrap/ Foundation layouts:
  56. This requires any of _optional core Field Layout, Layout Builder, DS, Panelizer,
  57. or Widget modules to function.
  58. Please refer to their documentation for better words.
  59. o Visit GridStack UI to enable the static grid support:
  60. /admin/structure/gridstack/ui
  61. Choose either Bootstrap, or Foundation under "Grid framework".
  62. Only one grid framework can exist globally.
  63. Be sure to fill out the required Grid library to make it work with core Layout
  64. Builder. It won't be loaded at front-end, only needed at admin pages, so be
  65. sure you have a theme, or module, which loads it at front-end.
  66. o Visit GridStack optionset collection page:
  67. /admin/structure/gridstack
  68. - Create, or clone existing "Default Bootstrap", or "Default Foundation".
  69. The required option: "Use static Grid Bootstrap/Foundation framework".
  70. Disabled once saved to avoid issues.
  71. - Build a static grid layout with floating boxes in mind, say "Boostrap Hero".
  72. If a grid breaks, try putting them as nested grids within their own rows.
  73. - Leave "xl width" option empty if not desired, such as for Bootstrap 3.
  74. The "XL" grid class is only available at Bootstrap 4.
  75. - Clone existing optionsets to reduce steps.
  76. o Clear cache whenever updating/ editing existing layouts.
  77. - Don't always do this when all needed layouts are in place.
  78. o Assign the newly created layouts at any UI for Field, DS, Panels, Panelizer,
  79. Widget:
  80. /admin/structure/types/manage/article/display
  81. /admin/structure/panelizer/edit/node__article__default__default/layout?js=nojs
  82. /admin/structure/block
  83. - Put relevant contents to each GridStack region.
  84. SIMILAR MODULES
  85. http://dgo.to/mason
  86. Both try to solve one problem: empty gaps within a compact grid layout.
  87. Mason uses auto Fillers, or manual Promoted, options to fill in empty gaps.
  88. GridStack uses manual drag and drop layout builder to fill in empty gaps.
  89. ROADMAP
  90. [x] Support multi-styled images to have various sizes, only if doable. Currently
  91. using CSS background images to solve sizes.
  92. 2/29/16
  93. [x] Multi-breakpoint responsive grid layouts.
  94. 3/11/16
  95. [x] Multi-breakpoint image styles.
  96. 3/14/16
  97. [x] Supports lightbox boxes.
  98. 12/14/16 for Field formatter, or use Blazy for Views images.
  99. [x] Decouple from Views to make GridStack a more generic layout builder.
  100. 2/27/2017
  101. [x] Optional integration with core layout_discovery (core >= 8.x-3) and
  102. layout_plugin (core < 8.x-3) so that gridstack layouts are exposed to DS,
  103. Panelizer, Panels, etc.
  104. 3/22/2017
  105. [x] Supports Bootstrap 4 for XL breakpoint.
  106. 3/29/2017
  107. o Use Vanilla JS for frontend.
  108. The following may likely happen by some personal project, or sponsorship.
  109. [x] Field formatter
  110. 12/14/16
  111. [x] Multimedia boxes.
  112. 12/14/16
  113. [x] A generic layout builder for Bootstrap, or Foundation.
  114. 3/22/2017
  115. o Field widget.
  116. o Stamps.
  117. o D7 port.
  118. Feel free to get in touch if you'd like to chip in, or sponsor any. Thanks.
  119. TROUBLESHOOTING
  120. o Be sure the amount of Views results are matching the amount of the grid boxes.
  121. o Follow the natural order keyed by index if trouble with multiple breakpoint
  122. image styles.
  123. o Clear cache when updating cached Gridstack otherwise no changes are visible
  124. immediately. You can also disable the Gridstack cache during work.
  125. Below are valid for v0.2.5 below:
  126. o At admin UI, some grid/box may be accidentally hidden at smaller width. If
  127. that happens, try giving column and width to large value first to bring
  128. them back into the viewport. And when they are composed, re-adjust them.
  129. Or hit Clear, Load Grid, Save & Continue buttons to do the reset.
  130. At any rate saving the form as is with the mess can have them in place till
  131. further refinement.
  132. o Use the resizable handlers to snap to grid if box dragging doesn't snap.
  133. Be gentle with it to avoid abrupt mess.
  134. o If trouble at frontend till gridstack library is decoupled from jQuery UI or
  135. at least till jQuery related issues resolved, for its static grid, check the
  136. option "Load jQuery UI". If you are a JS guy, you know where the problem is.
  137. A temporary hacky solution is also available:
  138. /admin/structure/gridstack/ui
  139. TIPS
  140. To have re-usable different image styles at multiple breakpoints, create them
  141. once based on grid dimensions to easily match them based on the given dimension
  142. hintings, e.g.:
  143. o Box 1x1
  144. o Box 1x2
  145. o Box 2x1
  146. o etc.
  147. Enable GridStack UI and visit "/admin/structure/gridstack" and edit
  148. your working optionset to assign different image styles for each box of the
  149. GridStack. Then you can match those image styles with the provided dimension
  150. hints easily -- 2x2 for Box 2x2, etc. Try giving fair sizes so that they fit
  151. well and have no artifacts at multiple breakpoints.
  152. Or use more simplified image styles like below:
  153. o Box square
  154. o Box tall
  155. o Box tower
  156. o Box wide
  157. o Box panorama
  158. And assign the largest dimensions to avoid artifact.
  159. With "Use CSS background" option enabled, those sizes don't matter much.
  160. Use Blazy formatters to have Colorbox/Photobox/Photoswipe supports.
  161. CURRENT DEVELOPMENT STATUS
  162. A full release should be reasonable after proper feedbacks from the community,
  163. some code cleanup, and optimization where needed. Patches are very much welcome.
  164. Alpha and Beta releases are for developers only. Be aware of possible breakage.
  165. However if it is broken, unless an update is explicitly required, clearing cache
  166. should fix most issues during DEV phases. Prior to any update, open:
  167. /admin/config/development/performance
  168. Re-generate CSS and JS assets, and hit "Clear all caches" button.
  169. KNOWN ISSUES
  170. o Having the exact amount of items to match the optionset grids is a must.
  171. o If you have more items than designated optionset grids, the surplus will not
  172. be displayed as otherwise broken grid anyway.
  173. o If you have less items, the GridStack will not auto-fix it for you.
  174. Simply providing the exact amount of items should make it gapless grid again.
  175. o Not compatible with Responsive image OOTB. GridStack has its own managed
  176. multi-styled images per breakpoint.
  177. o Nested grids are only supported by static grid Bootstrap/ Foundation, not JS.
  178. AUTHOR/MAINTAINER/CREDITS
  179. gausarts
  180. Contributors:
  181. https://www.drupal.org/node/2672858/committers
  182. THIRD PARTY MATERIALS
  183. gridstack.js
  184. The version of gridstack.js included in this project is a derived from
  185. gridstack.js 0.3.0-dev
  186. http://troolee.github.io/gridstack.js/
  187. (c) 2014-2016 Pavel Reznikov, Dylan Weiss.
  188. It was licensed under the MIT license.
  189. It has been modified by Gaus Surahman to work with Drupal.
  190. The modified version removed deprecated methods worth ~20Kb minified (half),
  191. suitable only for static grid option as normally seen at static frontend.
  192. gridstack.css
  193. The version of gridstack.css included in this project is a derived from
  194. gridstack.css 0.3.0-dev
  195. http://troolee.github.io/gridstack.js/
  196. (c) 2014-2016 Pavel Reznikov, Dylan Weiss.
  197. It was licensed under the MIT license.
  198. It has been modified by Gaus Surahman to work with Drupal.
  199. The modified version provided modularity which is not accommodated by
  200. the original file.
  201. READ MORE
  202. See the project page on drupal.org: http://drupal.org/project/gridstack
  203. See the GridStack JS docs at:
  204. o https://github.com/troolee/gridstack.js
  205. o http://troolee.github.io/gridstack.js/