We have patched menu_minipanels to allows other modules to add custom styles other than standard qtip ones; in external module you have to implement hook_menu_minipanels_styles (to provide a list of new styles) and hook_menu_minipanels_style (to add a new javascript to the page with the new style definition). Example:
mymodule.module:
function mymodule_menu_minipanels_styles() {
$options_style = array(
'mystyle' => t('mymodule style'),
);
return $options_style;
}
function mymodule_menu_minipanels_style($menu_config) {
if($menu_config['style']['name'] == 'mystyle') {
$path = drupal_get_path('module', 'mymodule');
drupal_add_js($path . '/js/menu-style.js');
}
}
menu-style.js:
$.fn.qtip.styles.mystyle = { // Last part is the name of the style
background: '#A2D959',
color: 'black',
border: {
width: 7,
radius: 5,
color: '#A2D959'
},
name: 'light' // Inherit the rest of the attributes from the preset dark style
};
I hope this will be useful
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | menu_minipanels-n1148958-5.d6.patch | 4.85 KB | damienmckenna |
| #4 | menu_minipanels-n1148958-4-d7.patch | 4.65 KB | damienmckenna |
| #3 | menu_minipanels-n1148958-d7.patch | 4.51 KB | damienmckenna |
| menu-minipanels-allows-external-styles.patch | 1.66 KB | lussoluca |
Comments
Comment #1
damienmckennaNice. I'll work on adding this to D6 and D7.
Comment #2
damienmckennaOther than a patch for D7, it also needs some proper API documentation before it can be added.
Comment #3
damienmckennaHere's a patch for D7, including API documentation.
Comment #4
damienmckennaUpdated D7 patch that fixes some problems, I've tested this and it works as described. Updated D6 patch will be forthcoming.
Comment #5
damienmckennaA patch for the D6 branch.
Comment #6
damienmckenna@lussoluca: Thanks for the patch, I've committed the change to both D6 and D7.
Comment #8
drupalina commentedI want to make my menupanels as wide as 960px (the width of the entire theme) and spanning across the width of the theme (very common feature in websites these days), so I have set it at that number in my menu settings.
But it only goes up to 700px or so... and according to Firebug this number varies from menu to menu.
So it seems like this needs a bit more work.
Comment #9
scottsawyerI am using v 7.x-1.x-dev with Omega Theme. In the mini-panel, I have a container column with class container-12, and 3 columns with grid-4. However, when it renders, the column w/ container-12 never renders. Trying to figure out if this is because of mini-panel or the way Menu Mini-Panels handles the rendering. Thoughts?
Comment #10
scottsawyerOk, now i think it's a mini-panels issue. Just added my mini-panel to a panel page and the container row is not rendered. Going to check there if there is a known issue.
Comment #11
scottsawyerWell, I am still having problems with the width of the qTip. I think allowing it to auto grow would be the best solution.
So, I guess this has become a feature request, maybe offer a checkbox in the configuration to allow the width of the qTip to auto grow or be a fixed width.
Comment #12
drupalina commentedI definitely support the feature request #11 by scottsawyer!
It appears that there's some weird calculating script inside the qtip javascript, which renders (unpredictably) different widths depending on which menu item we hover. It would be great to have an overriding feature in the module that would dictate "No, if set, let it grow to the fixed specified X width"
Comment #13
scottsawyer@drupalina I got around this by specifying the width in the style sheet with an !important declaration. Not beautiful, but functional. I am using this with Omega in a Mini Menu, so I had to create a rule for each view port I am supporting, which it fine, except my mobile view port, which should be fluid, and should shift from multiple columns to single column. Definitely forcing me to create many more style rules, and over riding them over and over. What should be simple is now a ...
Comment #14
drupalina commented@scottsawyer that seems like a genius of a temporary work-around.
I used
and it worked! Thanks!!!
The question now is how to center those unfolding minipanels so that they do not drift out of the bounds of the screen??? Any ideas?
Comment #15
drupalina commentedanswering my own question about how to center the unfolding menu -- in Menu settings, in the "Hover position configuration", I just chose Target: "Custom" and in the "Target Custom" field entered #menu-bar, which is where my main menu parents are located.
Comment #16
damienmckenna@drupalina: Please open a new issue for this support request / feature request, this issue is for a feature request that has already been committed. Thank you.