It would be a nice feature if somewhere in the panels settings you could specify what the default style would be when adding new panes.

For instance we are creating a website right now that almost all of the panes are use the "System Block" style to match the styling normal system blocks get. This means that each time a pane is added you have to remember to go in to the style for that pane and choose the "System Block" style which is a bit of a pain.

You also cannot choose styles in the IPE which means we cant really use the IPE. Each new pane you would add through it you would then have to go into the panel content and manually change the pane style, which makes the IPE not so useful for adding panes, though it is handy for editing them quickly.

#8 874002_panes_default_style.patch1.56 KBLetharion


Yeah, I can see this being a useful option.

Me too. Subscribing...



Subscribing. This would be a nice feature to have. There are quite a few people who can create new content in my sites panes. They need to be instructed now to use the right style.

A possible workaround could be to switch the default style to the desired style although I did not try that myself.

Has there been any progress on this?

Assigned:Unassigned» merlinofchaos
Status:Active» Needs review
new1.56 KB

The patch is in no way ready, but I would appreciate if you could take a look at it.
1) Where should the select box be?
2) Where should I be setting the default? I can't seem to reach the configuration from the function where I do it now?
3) Other things?

I imagine that the place to have the configuration would be on the /admin/build/panels/settings page or the sub pages of that so that each type (page, mini, panel node) could have it's own custom setting?

Bugger if i can find where those forms are built, panels and ctools seem so integrated its hard to tell which one controls what, had to stop looking before my head exploded.

merlinofchaos is there any direction you can give us for figuring this out?

This would be an awesome feature.

Has anyone had any luck with this since #8?

I've made two custom style plugins, one with a select list for choosing from a list of CSS classes and another with just a CSS class text-field input and would love if I could disable the other ones (aside from the default no style). That way I could style the no style option and give a site-specific selection of styles for editors to choose from. It took me a while to get my head around writing the style plugins (I used to just add classes through the panels admin section) but now that I know how I realise it's a fantastic feature for quick styling, especially through the in place editor.

The ideal situation would not only be an interface for enabling and disabling styles in the admin but a system where you could use roles and context to choose which styles were available. That way the in place editor could allow different styles on different pages and for different users which would be an amazing feature.

Okay, to do it right there probably needs to be something that is passed into the display during edit mode so that the editor can figure out proper defaults. Kind of like the setting as to whether or not there should be a display title. Then, individual apps can pass that in.

You also need to not only select a default style, but if it has config, have a form for that config.

For the panel context, which is the logical first benefactor of this functionality, the page for this should probably be somewhere hear the available content page.

Assigned:merlinofchaos» Letharion
Status:Needs review» Needs work

Moving back to myself for work.

Any progress on this?

Just a thought, what if new panes just inherited whatever style you set to its parent container?

And also any progress on D7?

This is a pretty important feature to have. Has anyone attempted it in the 3 years this request has been open?

Version:6.x-3.x-dev» 7.x-3.x-dev

I aim to have this feature in Semantic Panels but there is no hook (to my knowledge..) that can be used to set styling on new panes.

I created a patch that adds the drupal_alter I need. See #1985980: Allow altering of new panes

This would be a solution to atleast allow other modules to provide this feature.

I hope it was ok to change this to 7.x?

@emattias... how do you envision setting a different default style after adding #1985980: Allow altering of new panes ?

Edit: figured it out

function MODULE_panels_new_pane_alter(&$pane) {
$pane->styles['style'] = 'my-widget-style';

What I need to figure out now is that my-widget-style also has a settings form. Any suggestions no how to kick that off for new panes?


In D7 this should be:

function MODULE_panels_new_pane_alter(&$pane) {
$pane->style['style'] = 'my-widget-style';