I am really really tired from getting the question "Why does the site tell me to resize it?!" from clients when I forget to delete the 6 lines in Alpha template.php where the Resize Me! indicator is added to $vars['page_bottom'].
There should be an option on the main theme options to enable/disable this.
I have created this option. I'm just making a proper GIT patch right now.
Alpha/template.php has changed to only add the indicator to the page bottom when the site is in responsive mode AND the setting enable_resize_indicator is TRUE.
Changes:
alpha/template.php -- Add check for enable_resize_indicator in settings
154 if ($theme->settings['responsive'] && $theme->settings['enable_resize_indicator']) {
155 $vars['page_bottom']['alpha_resize_indicator'] = array(
156 '#type' => 'markup',
157 '#markup' => '<div class="alpha-resize-indicator"></div>',
158 );
159 }
alpha/alpha.info -- Add setting in info file. Default to enabled (I guess that's what 1 means)
215d214
settings[alpha_enable_resize_indicator] = '1'
alpha/includes/theme-settings-general.inc -- Add the setting checkbox directly under the Enable Responsive checkbox on main theme settings tab
$form['alpha_settings']['layout']['responsive_settings']['alpha_enable_resize_indicator'] = array(
'#type' => 'checkbox',
'#title' => t('Enable the "Resize Me" indicator at the bottom of the page'),
'#description' => t('Enabling this will add a floating indicator in the bottom right corner directing the user to "Resize Me" for responsive designs.'),
'#default_value' => $theme->settings['enable_resize_indicator'],
);
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | omega-enable_resize_indicator_option-1602104.patch | 3.01 KB | ianmarcinkowski |
| #1 | omega-enable_resize_indicator_option-1602104.patch | 2.35 KB | ianmarcinkowski |
Comments
Comment #1
ianmarcinkowski commentedAttaching patch file.
Comment #2
ianmarcinkowski commentedComment #3
ianmarcinkowski commentedI forgot to pull the setting in to the settings array. Oops. Here is the revised patch.
Comment #4
ianmarcinkowski commentedErr.. Here is the revised patch. :D
Comment #5
ianmarcinkowski commentedComment #6
drupaleye commentedTried to apply the patch #4. Using Omega 7.x-3.1 Alpha 7.x-3.1 and subtheme Respond. The check-box is visible in the theme RESPONSIVE SETTINGS, but is always enabled even after disabling and saving. And the most important: The "resize me" div does not appear. (Patch applied manually.)
(edit)....
I guess I was trying to achieve the opposite of the original question. The patch worked, but only when debug is enabled. In the alpha template.php, the code patch is inside the if-debug statement. To make the resize me label appear without debugging enabled, I did like this (after applying patch #4):
In your css you also have to use this:
Last step: copy the file resize-handle.png from the Alpha image folder to your theme image folder or make your own image.
This probably will be overwritten by updates to the Omega Alpha theme, so I don't know if this is good practice. But it works for now.
Comment #7
steinmb commentedComment #8
steinmb commented