8 – Why jquery menu collapse on all pages except front page

I have a Drupal 8 site and them (upgraded from Drupal 7) and the main menu collapses to a button when the page is narrow enough (i.e. on a mobile device). Or at least it is supposed to. I did not design the theme.

SITUATION

Unfortunately when the menu is collapsed into a button, clicking on the button does NOT open the menu.

SITE SETUP

It seems that the old theme used jQuery to handle the collapse of the menu.

I have installed the jquery_ui module.

I added jquery to the .libraries.yml file

  dependencies:
    - core/jquery
    - core/jquery.ui
    - core/jquery.once

There are 4 template files which the only reason I can see is so that the main menu (which is hardcoded) can style the active menu item for the page.

  • page–node–2.html.twig
  • page–node–3.html.twig
  • page–node–6.html.twig
  • page.html.twig

Each of those pages has as the last line of the page a reference to the JavaScript file located in the site as

<script src="https://drupal.stackexchange.com/sites/all/themes/custom/mytheme/js/main.js"></script>

FIXED SOME OF IT

Adding jquery.main.js to the /js directory and adding the reference to it in the .library.yml file as

  js:
    js/main.js: {}
    js/jquery.main.js: {}

was enough to get all of the pages to collapse and open the menu EXCEPT THE FRONT PAGE.

JURY-RIG

I can get the front page menu to work if I add a reference to the bottom of the page to the jquery.main.js file I manually added to the local /js directory.

<script src="https://drupal.stackexchange.com/sites/all/themes/custom/mytheme/js/main.js"></script>

But then the other pages (not node 2, 3 or 6) which should use page.html.twig are run, it does NOT un-collapse the menu.

So for now I make a page–front.html.twig file which includes BOTH script referecnes to the JavaScript files, and all other pages have just the one (to main.js).

QUESTION
I have a couple:

  1. What is the more standard way to situate this? I don’t imagine that having a local jquery.main.js file is the best solution but it wasn’t working with out it.
  2. Why would the front page not operate like the other pages in accessing the JavaScript and jQuery?

Thank you for any insight.

javascript – Como faço para aparecer o menu quando eu posicionar o ouse em cima do incon?

@font-face {
    font-family: 'california';
    src: url('font/Hai_California.ttf');
    src: url('Hai_California?#iefix') format('embedded-opentype'),
      url('font/Hai_California.ttf') format('svg'),
      url('font/Hai_California.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    /* 
    
        Usa uma fonte externa (baixada ou internet) e disponibiliza para que 
        caso o usuário não tenha a mesma instalada na sua máquina, seja feito o
        download da fonte.
    
    
    */
  }
html, body {
        background-color: #ffff;   
        margin: 0;
        padding: 0;
}
img.menu_icon {
        margin-left: 15px;
        margin-top: 15px;
        width: 50px;
        height: 50px;
}
img.menu_icon:hover > div#menu{
    display: block;
    visibility: visible;
}
img.logo {
    display: block;
    margin-left: auto;
    margin-right: auto;
}
#header {
    position: absolute;
    top: 0px;
    width: 1366px;
    height: 220px;
    margin: 0px;
    background: rgb(245,183,46);
    background: linear-gradient(0deg, rgba(245,183,46,1) 0%, rgba(249,219,92,1) 100%);
    color: black;
}
#menu {
    opacity: 0.75;
    position: absolute;
    top: 0px;
    width: 1366px;
    height: 220px;
    margin: 0px;
    background-color: #cc444b;
    color: white;
    visibility: hidden;
    display: none;
    
}
#menu ul li {
    list-style: none;
}
#header h1 {
    margin-top: 50px;
    text-align: center;
}
.logo {
    margin-top: -250px;
    width: 120px;
    height: 120px;
}
/*

    Centraliza a imaem dentro do header

*/
.logo_nome {
    margin-top: auto;
}
.logo_nome a {
    color: black;
    text-decoration: none;
}
.conteiner img {
    max-width: 200px;
    max-height: 150px;
    width: auto;
    height: auto;
}
h1 {
    font-weight: bold;
    text-shadow: 5px 5px 7px #6b722d;
    font-size:  70px;
    font-family: california, cursive;
}
<!DOCTYPE html>
<html lang="pt-br"> 
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link rel="sortcut icon" type="image/x-icon" href="fotos/logo.png"> 
        <link rel="stylesheet" type="text/css" href="css/index.css" >
        <title>Sal de Ouro</title>
    </head>
    <body>
        <div id="header">
            <div id="menu">
                asdasdasd
                    <ul>
                        <li><a href="">Teste</a></li>
                        <li><a href="">Teste</a></li>
                        <li><a href="">Teste</a></li>
                        <li><a href="">Teste</a></li>
                        <li><a href="">Texte</a></li>
                    </ul>
            </div>
            <img class="menu_icon" src="https://pt.stackoverflow.com/fotos/menu.png" >
            <h1>Sal de Ouro</h1>
            <img class="logo" src="fotos/logo.png" /> 
        </div> 
        <script type="text/javascript" src="javascript/index.js" />
    </body>
</html><!DOCTYPE html>
<html lang="pt-br"> 
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link rel="sortcut icon" type="image/x-icon" href="fotos/logo.png"> 
        <link rel="stylesheet" type="text/css" href="css/index.css" >
        <title>Sal de Ouro</title>
    </head>
    <body>
        <div id="header">
            <div id="menu">
                asdasdasd
                    <ul>
                        <li><a href="">Teste</a></li>
                        <li><a href="">Teste</a></li>
                        <li><a href="">Teste</a></li>
                        <li><a href="">Teste</a></li>
                        <li><a href="">Texte</a></li>
                    </ul>
            </div>
            <img class="menu_icon" src="https://pt.stackoverflow.com/fotos/menu.png" >
            <h1>Sal de Ouro</h1>
            <img class="logo" src="fotos/logo.png" /> 
        </div> 
        <script type="text/javascript" src="javascript/index.js" />
    </body>
</html>

terminal – How do I disable extensions in share menu : airdrop, mail, add people, messages in High Sierra on mac

I would like to use terminal to disable share menu items in extension on my mac. Im using a migrated system and running High Sierra. Ive tried everyway and apple insists that it cannot be done. I know it can be done using terminal. Im a victim of hacking as a design firm owner and the person/s have continued to access my machines. I erased machines and still had issues like : keyboard on lock screen and no remote login enabled, no reason to have any sharing here etc. Someone obviously knew how to access my network to get a brand new machine disabled by an accessory tool that I did not need. thus a new machine erased.

windows – The limit of Windows10 Context Menu Share (the size and count of file)

I noticed that Share feature in right click context menu may be failed to share files sometimes (like the screenshot)

enter image description here

In my PC, I usually met this problem if I selected more than 10 files (11 png, total size is 385KB), but it could work sometimes (the content of share panel could be shown and features could work correctly).

Another case was I selected 4 videos (total size is around 10 MB) and encountered same problem.

I couldn’t find any document on Microsoft site to elaborate the limitation, does anybody knows the limit of context menu share feature? Or you guys can point me a way to find the limitation. Many thanks.

P.S My PC’s version

enter image description here

Menu Items disappearing/being empty on save or post edit

I’ve been having this weird issue on a site for a few weeks now, tried everything I found by searching but still not being able to find a clue of the issue.

Whenever I add some items to the Menu (Appearance > Menus), a few items become empty. And then gets removed when I click the Save button again. Similarly, if I edit any posts, the same thing happens with the menu items.

Here’s what I’ve tried so far,

  1. Increased max_execution_time, max_input_vars, max_input_time, memory_limit, post_max_size, upload_max_filesize, max_file_uploads in PHP.ini. I set those to very high numbers but still no luck
  2. Then I tried copying the site to another hosting and on my localhost, but no luck. Did #1 on all the environments.
  3. Changed the theme to default 2021 and deactivated all plugins, still no luck
  4. Checked the database, wp_posts table has 4.6k rows with size of total 10.8MB, with overheads of about 300KB. So, I tried changing the storage engine of that table to innoDB from MyISAM but the problem is still happening.

Is there anyone who faced similar condition? What could be the issue?

applications – how do i avoid app from minimizing when option menu icon selected

i tried this code, but app minimize when option menu selected, what wrong with startActivity

i have added about, help in menu option, menu is opening, but when i click on option to go other activity, my app minimize

switch (item.getItemId()) {
case http://R.id.about:
startActivity(new Intent(this, About.class));
return true;
case http://R.id.help:
startActivity(new Intent(this, Help.class));
return true;
default:
return super.onOptionsItemSelected(item);
}

8 – How would I create and render, but not save, an entire menu tree programmatically?

I’m trying to pull a number of links from several services, and combine them into a renderable menu tree:

Source one: pull links A, B and C

Source two: pull links D and E

Source three: pull links F, G, and H

Desired end result: a menu tree object that I can render using core and contrib menu theming functions, structured like:

  • Parent 1
  • Parent 2
  • Parent 3

It seems like this is simple enough to do with a menu that’s been saved to the database, but as the contents of the links from each of these sources may change at any time, I’m looking to build the menu on the fly. I can create menu items out of the data, but I’m having trouble creating and populating a tree with them. All the documentation and posts I’ve been able to find seem to assume you’re loading a tree from a pre-existing menu. I think what I need to do is create a new, empty tree, and add the links to it. Is there a way to do this?