Blog

Featured

Tom’s Blog

Here’s where I post various discoveries and solutions for Drupal and WordPress, or other interesting and useful tools for the Web.

If you’re having a problem with your website, just zip me an email and I’ll see what I can do to help!

Migrate Live (Production) Drupal Site to Dev Desktop

Here’s my step-by-step instructions to migrate a live (production) Drupal site to Dev Desktop.  This is useful for those instances when you may need to test updates/changes/etc on a local environment before applying them to your production site.

  1. Download and Install Dev Desktop
  2. Important Step! Disable all caching and js/css aggregation on production site
  3. Clear cache on production site
  4. Download production site mysql database via PHPMyAdmin
  5. Compress and download all site files (codebase)
  6. Import local Drupal site via Dev Desktop using production site codebase and database (click on the + icon)
  7. Typically your site should launch via Dev Desktop, but there may need to be a few ‘tweaks’ as follows:
  8. If the production site is using a reCaptcha module for the user login, you’ll need to disable this module to login into the site.  I like to use drush via the Dev Desktop by clicking on the black box to the right of the local code link.  When the console opens, enter: drush dis recaptcha
    It’s good to clear the cache again: drush cc all
  9. If the $cookie_domain has been defined in the settings.php file, you’ll need to comment that out (#).  You may need to comment out (#) other previously defined settings such as file_temporary_path and/or site_mail.
  10. If the production site is forcing ‘www’ in the .htaccess file, you’ll need to comment this out (#)
  11. You may also need to comment out (#) the following line in the .htaccess file: AddHandler application/x-httpd-phpbeta .php
  12. If the production site is using a ‘prefix’ for the database tables, you’ll need to add that ‘prefix’ to the loc_sitename_dd.inc file.  This file is located on your local machine: C:/Users/xxx/.acquia/DevDesktop/DrupalSettings.  The following would be added to the file above the ‘port’ => xxxxx line (the example below is using dr_ for the prefix. You’ll need to change this to your specific prefix):’prefix’ => ‘dr_’,
    ‘port’ => xxxxx );

Drupal Mobile Sliding Menu

The Mobile Sliding Menu module for Drupal works well, but attention to installation and configuration is important.

Required modules:

Required libraries:

Installation:

  • Install the Mobile Sliding Menu, jQuery Update, and Libraries modules in your sites/all/modules folder
  • Unzip the MMenu Libraries file and put it into your sites/all/libraries folder
  • Enable the module and run cron your Drupal site.  You should see the following information:

Configuration:

To access the configuration settings…/admin/config/mmenu/mmenu_left

This YouTube video has detailed information about installation and configuration.

I am using this module on sacredvoice.com.  Here are my configuration settings for using the RIGHT MENU with THREE BLOCKS:

  • BLOCK:
    Select a block: System – Main Menu
    Menu Parameters: default
    Title: ☰ Menu
    Collapsed: No
    Wrap: No
  • BLOCK:
    Select a block: Mmenu – Search
    Menu Parameters: default
    Title: Search sacredvoice.com
    Collapsed: No
    Wrap: No
  • BLOCK:
    Select a block: Block – Footer
    Menu Parameters: default
    Title: blank
    Collapsed: No
    Wrap: Yes
  • MMENU OPTIONS:
    Theme: mm-basic
    Effects: none selected
    Sliding Submenus: No
    Clickopen (Add-on):
    Open: Yes
    Selector: #open

    this is inserted into a block in the header with this code:<a href=”#” id=”open”>&#9776; Menu</a>the block css is float:right; margin-top: -45px;the block css is modified with media queries to adjust position on smaller screens

    Counters (Add-on):
    Add: No
    Update: No
    Dragopen (Add-on):
    Open: Yes
    pageNode: body
    Threshold: 100
    MaxStartPos: 50
    Footer (Add-on):
    Add: No
    Header (Add-on):
    Add: No
    Labels (Add-on):
    Collapse: No
    OffCanvas (Add-on):
    Flag: Yes
    Modal: No
    MoveBackground: Yes
    Position: right
    Zposition: next
    Searchfield (Add-on):
    Add: No

  • MMENU CONFIGURATIONS:
    I made only 1 modification to the default settings.
    OFFCANVAS (ADD-ON):
    PageSelector: #mm-pageIn the page.tpl.php file, I wrapped everything with:
    <div id=”mm-page”></div>

The results of my configuration is a menu that slides in from the right and pushes the main content over with it when either clicking on the Menu link or sliding across the right side of the page.

Note: the mmenu libraries that are included in the zip file are NOT the most recent releases.  Use the versions included and the you will have expected results.