This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

Does Commodore menu require JavaScript to be enabled?

  • Creator
    Topic
  • #23235
    u34fewe23
    Participant

    On a mobile device where JavaScript is disabled in the browser, my Commodore menu collapses to an icon with three lines. But this button is unresponsive–I assume because it requires JavaScript. So my questions are:

    (1) Does the Commodore menu require JavaScript to be enabled?

    (2) If so, is there any way I can alert the user? I tried to insert a <noscript></noscript> HTML message in a Content–>Raw Content box, but the Commodore theme removed it (presumably because it couldn’t parse the “noscript” command).

    Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #23240
    Jason Bobich
    Keymaster

    Hello,

    (1) Does the Commodore menu require JavaScript to be enabled?

    Yes, your assumption is correct. The menu requires javascript in order to toggle the menu to display and hide.

    (2) If so, is there any way I can alert the user?

    Unfortunately there is no feature in the theme for this, and would be a customization you’d need to make.

    In this day and age, it’s fairly safe to assume all browsers, mobile and desktop, are going to have javascript enabled. It’s not really common practice any more to have to alert users that javascript is required, but I’m sure that could be argued fairly easily. In most cases, if javascript is disabled on a web browser, it’s been done by a user who knows what javascript is (in order to disable it), and is doing so on purpose; so a person doing this most likely understands that javascript is needed on most websites on the Internet.

    Anyway with that said, that’s just my personal opinion, not knowing anything about your website or your audience. You’re free to make whatever customizations you like to accommodate this. I could see the benefit, given other possible factors.

    I tried to insert a HTML message in a Content–>Raw Content box, but the Commodore theme removed it (presumably because it couldn’t parse the “noscript” command).

    Personally, I would think it would make the most sense to hook something like this in from your child theme, and not from your WP admin on individual pages or custom layouts.

    From your child theme’s functions.php, you’d just hook your notice to something like themeblvd_before, and it can be outputted at the top of your website, throughout all pages.

    function my_javascript_notice() {
    	echo '<noscript>';
    	echo '<p>Please enable JavaScript to use this page!</p>';
    	echo '</noscript>';
    }
    add_action('themeblvd_before', 'my_javascript_notice');

    Maybe helpful:

    http://dev.themeblvd.com/tutorial_category/chapter-01/

    http://dev.themeblvd.com/tutorial_category/chapter-02/

    #23244
    u34fewe23
    Participant

    Hi Jason,

    Thanks for your response.

    The PHP function you posted is perfect.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The forum ‘Commodore WordPress Theme (formerly Complexity)’ is closed to new topics and replies.