Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I've searched everywhere for an example of the statement needed in the theme.info file so that the theme can store Panels 3 layouts. I've tried both:
plugins[panels][plugins] = layouts
and
plugins[panels][layouts] = layouts
...and put my custom panels layouts into layouts/test inside my theme, where test is the name of my panel layout, and contains test.inc, test.css and test.png.
However it refuses to work. Can someone enlighten me?
Comments
Comment #1
merlinofchaos CreditAttribution: merlinofchaos commentedplugins[panels][layouts] = layouts
is the correct one.The other issue you might be facing is naming.
In test.inc you should have this code:
Finally, the other issue is that your theme must be marked as 'enabled' on the themes page. It is possible to have the primary theme active but not enabled (This is a bug in Drupal itself) so please be sure to doublecheck that.
Comment #2
jeff h CreditAttribution: jeff h commentedThanks for such a prompt reply... it now works for me!
I had the wrong function name. Instead of:
function THEMENAME_test_panels_layouts()
I had
function panels_test_panels_layouts()
because I developed this particular layout inside the panels layouts directory then moved it into my theme.
Thanks again!
Comment #3
jeff h CreditAttribution: jeff h commentedUnfortunately it seems this has broken in the later versions of the module. It broke in beta 1 I believe, and I have just upgraded to beta 3 without any better results.
Basically, I had it working, and have changed nothing, but now none of the layouts in my theme directory are found, even though they're still specified in my theme's .info file.
Comment #4
jeff h CreditAttribution: jeff h commentedSorry, I should mention I have temporarily copied my custom layouts into the panels/plugins/layouts folder and they work fine there (after modifying the hook_panels_layouts() function names appropriately).
Comment #5
merlinofchaos CreditAttribution: merlinofchaos commentedI just doublechecked and this is still working.
HOWEVER.
There is a bug in Drupal that can cause the theme to no longer show up as enabled (even if it is the default hteme). For CTools to recognize it, it must be marked enabled. So doublecheck at admin/build/themes and make sure this did not happen.
Comment #6
jeff h CreditAttribution: jeff h commentedThanks again Merlin. Indeed you are right — my theme was mysteriously disabled, even though it was still in use throughout the site!
All layouts are again picking up fine from within my theme.
Comment #7
janamills CreditAttribution: janamills commentedHi merlin,
I think I am encountering the same problem, but I cannot enable any theme including the ones that come with core! I have been searching for info on this over at the Drupal issue queue but to no avail. You mentioned that this was a bug, do you know if there is a patch or have the link to the issue at all?
thanks!
Comment #8
janamills CreditAttribution: janamills commentedacctually, sorry for being an idiot. i just reset to default and then was able to enable themes again!