Skip to content
This repository has been archived by the owner on Sep 16, 2019. It is now read-only.

Add Customizer Option for Topbar or Offcanvas Mobile Menu #411

Merged
merged 6 commits into from
Aug 15, 2015
Merged

Add Customizer Option for Topbar or Offcanvas Mobile Menu #411

merged 6 commits into from
Aug 15, 2015

Conversation

AdamChlan
Copy link
Contributor

This pull request allows the user to select the type of mobile menu
they want - Topbar or Offcanvas - in the theme customizer.

header.php
Selectively output the code needed for an off-canvas menu. If the
customizer setting is offcanvas, that code will be output. I also fixed
what appears to be a bug introduced in the last merge. The
$GLOBALS['offcanvasposition'] was not being echoed when called in the
template.

footer.php
Selectively output the code needed for an off-canvas menu.

library/custom-nav.php
A new file creating the customizer options. also added a filter to add
“offcanvas” or “topbar” classes to the body tag to help with CSS
styles.

functions.php
calling custom-nav.php

parts/top-bar.php
added in the needed

  • for the mobile hamburger menu

    scss/site/_topbar.scss
    hiding .top-bar at breakpoint only if menu option is set offcanvas

  • This pull request allows the user to select the type of mobile menu
    they want - Topbar or Offcanvas - in the theme customizer.
    
    header.php
    Selectively output the code needed for an off-canvas menu. If the
    customizer setting is offcanvas, that code will be output. I also fixed
    what appears to be a bug introduced in the last merge. The
    $GLOBALS['offcanvasposition'] was not being echoed when called in the
    template.
    
    footer.php
    Selectively output the code needed for an off-canvas menu.
    
    library/custom-nav.php
    A new file creating the customizer options. also added a filter to add
    “offcanvas” or “topbar” classes to the body tag to help with CSS
    styles.
    
    functions.php
    calling custom-nav.php
    
    parts/top-bar.php
    added in the needed <li> for the mobile hamburger menu
    
    scss/site/_topbar.scss
    hiding .top-bar at breakpoint only if menu option is set offcanvas
    @olefredrik
    Copy link
    Owner

    Good stuff. Seems like a few build checks have failed, though. Could you have a look at it?

    @AdamChlan
    Copy link
    Contributor Author

    Thanks, Ole. I will have a look at how to run the tests on my end to make sure I get everything fixed.

    @AdamChlan
    Copy link
    Contributor Author

    Ole, the tests are passing now. I wasn't 100% sure about changing the the status badge to point to my repo, so if there is something else I need to do on that end, let me know.

    olefredrik added a commit that referenced this pull request Aug 15, 2015
    Add Customizer Option for Topbar or Offcanvas Mobile Menu
    @olefredrik olefredrik merged commit 3c9300e into olefredrik:master Aug 15, 2015
    @olefredrik
    Copy link
    Owner

    👍 awesome!

    @olefredrik
    Copy link
    Owner

    As of now the off canvas position is to be set multiple places. It kind of works, but the current solution is still not ideal. On a general basis I mean it's bad practice to put settings like this in template files (such as the header or the off-canvas-menu template). It would be quite cool if we could expose the 'left' or 'right' setting for off canvas position in the theme customizer menu, instead of hard coding the off canvas position as a global variable in various php files. Any thoughts about this, @AdamChlan ?

    @AdamChlan
    Copy link
    Contributor Author

    I was thinking the same this. I can integrate that functionality into the customizer panel.

    Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
    Labels
    None yet
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    None yet

    3 participants