By zigx on
Hi All,
I am using Genesis to development my theme and saw that Gpanels was recently implemented.
I've read the "wtf are gpanels" article and Genesis' documentation pages but i still dont fully understand why/when you use gpanels over regular panels.
Can anyone shed some light please?
Thank you!
Comments
I would ask this question in
I would ask this question in the support request queue for the Genesis Starter Theme. A quick glance at the docs didn't answer this question for me either. Which, in my particular case, means I would just use Panels.
Gpanels are a lightweight layout solution
Well, in the WTF are Gpanels article it does mention that Gpanels are for layout only and do not provide any of the other features of the Panels module such as context.
Panels is a great module, however its also a monster, in heavy development and potentially overkill when all you need is layout. Panels can do the layout bit no problem, however it's one heck of a module to install and maintain for the sake of layout.
I use Panels a lot, when I want context and when I need to show blocks on more than one region in different parts of my site. However, if all I need is layout, then I'll choose the light weight method of Gpanels.
Heres a simple example - on my homepage I want 4 column layout at the top, beneath the header, to show some blocks. With the Genesis theme and the 4 column Gpanel this takes about 2 mins to achieve, no additional modules, no coding what so ever.
With Panels you need to install a bunch of modules, learn how to build a mini-panel, configure it, drop it into a region and then upgrade Panels for ever, all for the sake of laying out 4 blocks.
Edit: added better explanation about the key differences to the docs on Gpanels for clarification.
Pimp your Drupal 8 Toolbar - make it badass.
Adaptivetheme - theming system for people who don't code.
jmburnz thanks for
jmburnz
thanks for responding! also thank you for your hard work on genesis.
...
I have added some new style selectors to the Genesis starter subthemes to make it easier to style Gpanels - http://drupal.org/project/genesis
Pimp your Drupal 8 Toolbar - make it badass.
Adaptivetheme - theming system for people who don't code.
using Gpanels in another theme.
There have been several comments that gPanels can be used in any theme. But I don't see any documentation on how to do it. There are some mention of putting the code snippets in page.tpl.php. But don't you have to copy the themes files in the right place too? It would be really good if there was some more explanation on what you need to do to incorporate them in a non-genesis theme.
...
Well to be frank I think I mentioned that once or twice here and there, but never-the-less it can be done because they work independantly of the themes core layout. As mentioned in the (very good) documentation you will find the layout CSS in layout.css (look in the uncompressed version which is actually readable), so just copy the relevant CSS to your theme’s style.css file and a Gpanel to page.tpl.php. In genesis_SUBTHEME page.css you will find a bunch of empty selectors to help you style them since the blocks will inherit your normal block styles and you may want them to look different.
BTW, I never said they will work without issue, of course if your theme has the sames classes there could be trouble, additionally if you are using some funky positioning of the content around the Gpanel you might be unexpected results. In any case, I have no plans to support the use of Gpanels outside of Genesis, so you are rather on your own with this one.
Pimp your Drupal 8 Toolbar - make it badass.
Adaptivetheme - theming system for people who don't code.