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.
Comment | File | Size | Author |
---|---|---|---|
#24 | 874002_panes_default_style-24.patch | 1.67 KB | mrjmd |
#8 | 874002_panes_default_style.patch | 1.56 KB | Letharion |
Comments
Comment #1
merlinofchaos CreditAttribution: merlinofchaos commentedYeah, I can see this being a useful option.
Comment #2
kant CreditAttribution: kant commentedMe too. Subscribing...
Comment #3
heylookalive CreditAttribution: heylookalive commentedSubscribing!
Comment #4
z1pzap CreditAttribution: z1pzap commentedSubscribing!
Comment #5
Johan den Hollander CreditAttribution: Johan den Hollander commentedSubscribing. 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.
Comment #6
karljohann CreditAttribution: karljohann commentedHas there been any progress on this?
Comment #7
clashar CreditAttribution: clashar commentedcame from #1257294: Set default style on Panel panes. for D7
Comment #8
Letharion CreditAttribution: Letharion commented@merlinofchaos
The patch is in no way ready, but I would appreciate if you could take a look at it.
Problems:
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?
Comment #9
codewatson CreditAttribution: codewatson commentedI 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?
Comment #10
Old Account CreditAttribution: Old Account commentedThis would be an awesome feature.
Comment #11
FilipNest CreditAttribution: FilipNest commentedHas 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.
Comment #12
merlinofchaos CreditAttribution: merlinofchaos commentedOkay, 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.
Comment #13
Letharion CreditAttribution: Letharion commentedMoving back to myself for work.
Comment #14
superjerms CreditAttribution: superjerms commentedAny progress on this?
Just a thought, what if new panes just inherited whatever style you set to its parent container?
Comment #15
clashar CreditAttribution: clashar commentedAnd also any progress on D7?
Comment #16
dv8withn8 CreditAttribution: dv8withn8 commentedThis is a pretty important feature to have. Has anyone attempted it in the 3 years this request has been open?
Comment #17
emattias CreditAttribution: emattias commentedI 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?
Comment #18
caschbre CreditAttribution: caschbre commented@emattias... how do you envision setting a different default style after adding #1985980: Allow altering of new panes ?
Edit: figured it out
Comment #19
caschbre CreditAttribution: caschbre commentedWhat 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?
Comment #20
michaelmol CreditAttribution: michaelmol commented@#18
In D7 this should be:
Comment #21
thtas CreditAttribution: thtas commentedHere is my code for this which doesn't require any patches:
Comment #22
Chris Gillis CreditAttribution: Chris Gillis commentedMarked #1814696: Changing the default "style" from "no style" to "no markup at all", or selecting default "style" for panes as a Duplicate.
#20 works for me in combination with the patch in #1985980: Allow altering of new panes
Comment #23
Chris Gillis CreditAttribution: Chris Gillis commentedNow that #1985980: Allow altering of new panes has been committed, it would be awesome to turn #20 into a UI setting.
Comment #24
mrjmd CreditAttribution: mrjmd commentedI took a look at this, but the problems mentioned in #8 still need to be answered. Specifically, how to get at the panel variant configuration from within panels_new_pane() or panels_panels_new_pane_alter(). My work-in-progress patch is attached, which allows saving of a default but does not actually apply it to new panels yet.
Comment #25
Albert Volkman CreditAttribution: Albert Volkman commentedOver in #2030075: Add a UI to allow someone to set default block, panel, pane settings we were discussing how this would be handy to be available for Panels and Region defaults as well. In my instance, the less user interaction required at this level, the better.
Comment #26
codewatson CreditAttribution: codewatson commentedWould it not be easier to have a global option to set what the default is, then whenever a new panel pane is added, part of the workflow of creating a new pane (no matter what type it is) would be to bring up the pane style configuration form?
Comment #27
Albert Volkman CreditAttribution: Albert Volkman commentedLooking at the patch in #24, the main issue with using hook_panels_new_pane_alter() is that the passed in $pane object does not have a display context (did is blank). Unless we change what gets passed into panels_new_pane(), or add another alter within panels_renderer_editor::ajax_add_pane().
However, if we go the route of creating a single administration section with defaults per pane type/subtype, then that should be feasible.
Comment #28
joelstein CreditAttribution: joelstein commentedInspired by #21, here's a hackish (but it works) way to force set a style for all regions and panes.
Comment #29
joelstein CreditAttribution: joelstein commentedNevermind, ignore that crazy hack I posted. It doesn't work in many situations and may result in loss of pane style configuration. :(
Comment #30
Chayemor CreditAttribution: Chayemor as a volunteer commentedThis is how I'm doing it in case it helps anyone else.
I have style set for my theme and the users are tired of having to click that "custom style" every time they create a newpanel. The featured they strongly asked for was for new panels to already have that style selected.
(I can't seem to add the image, this is the link for it http://oi68.tinypic.com/ndshec.jpg )
(Sorry options are in Spanish). The "custom style" is the one in all caps, and the last option was the one that was always marked by default.
Here's what I did inside one of my custom modules. You can actually determine if the panel is new by looking at its id, and then you can just alter the form's default value when that happens.