Active
Project:
Panels
Version:
7.x-3.x-dev
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
30 Mar 2012 at 18:06 UTC
Updated:
16 Dec 2015 at 09:06 UTC
Jump to comment: Most recent
Comments
Comment #1
merlinofchaos commentedIf it's a page manager page, page_manager_get_current_page() can help with that determination. (This'll work with Panelizer since it uses Page Manager for rendering).
Note that the latest Panels actually has a field that lets you directly add and remove body classes on the settings tab.
Comment #3
lmeurs commentedThanks for the tip, this seemed to help me:
Comment #4
BillyTom commented@lmeurs This is a very nice tip.
Should something basic like adding a body class not be in the module by default? If you are doing your page layout with panels you might need this information. And if you don't then it is not obtrusive in any way.
Comment #5
damienmckennaPanels already provides a way of doing this, on the main Settings page there's a field called "Add body CSS classes".
Comment #6
BillyTom commentedThis is not exactly what the OP suggested. What he suggested was that Panels automatically adds the machine name of the used layout to the body.
You can do this manually by adding your own class with "Add body CSS classes", but this can be tedious if you have to manage lots of panels.
Also, it is a potential source of errors if you change the layout of a panel but forget to update the class name in "Add body CSS classes".
So I would say it is a different feature.
Also, Drupal core already provides lots of body classes for easier styling. Maybe Panels should follow in the same footsteps.
Comment #7
damienmckennaClarifying the title.
Not all sites will want this, so maybe it should be optional?
Comment #8
mglamanNo patch - moving status from CNR. IMO this should be a "won't fix." There are plenty of ways to add this in a theme and not drop more classes into the markup than needed.
If you want to add classes to the body, then you could follow the example in #3.
IF you want this to work with Panelizer, you need to do this (Panelizer doesn't properly register with page_manager_get_current_page()). I've been meaning to flush it out, but it fixed our problem.
In ref to #2280191: Panelizer does not register with page_manager_get_current_page().
Comment #9
BillyTom commented@mglaman: In my experience more body classes are always a good thing.
I can't see a downside to adding this function to the module.
If additional classes are properly prefixed (panels-layout-x) then there should not be a conflict with other modules either.
Comment #10
osopolarNot actually what requested by this issue, but in some cases may helpful: #2502121: Allow panel panes to add body classes.
Comment #11
rajdcube commentedI am getting issue with the flow of product variation display as a single product in drupal 8.
Can anyone help me what will be the steps to follow to work on this?