How to close the navigation menu when you click outside ?

I have a site with the Bootstrap 3.3.7 theme and I want the farm navigation menu to click when I click outside.

I managed to make it work with the following code :

    (function ($) {
      'use strict';
    
      $(document).click(function (event) {
           $('.navbar-collapse-first').collapse('hide');
      });
    
    }(jQuery));

My problem :

When I click next to a link in the navigation menu, it closes. I want it to close only when I click OUTSIDE of the menu.

How to set Front Page

Hello Friends,

I am trying to set the Front Page of my Drupal website via a custom module I created. I think it should be noted that I also have a theme applied to my website.

I have looked around and it appears the solution has something to do with page--front.html.twig. I have located this file inside themeFolder/templates but I dont know what to do with it.

I tried literally creating this file inside myModule/templates/page--front.html.twig, with no success.

How to upload multiple images at once - form input

Hello friends,

I am trying to upload multiple images at once, using form input, but I have no idea how to achieve this?

my input looks as follows: 

    $form['listing_slides']['dbl_slides'] = array(
     '#type' => 'managed_file',
     '#title' => 'Slides',
     '#description' => 'Slides that visible on the listings page',
     '#upload_location' => 'public://upload/business_listing/slides',
     '#required' => TRUE,
    );

At the moment this only lets me select a single image for upload.

How to add .html.twig file to a region programatically?

Hello friends,

I am trying to add a template I have defined in my custom module to a region on my theme programatically.

I see there are regions defined in my theme .info.yml file, but I havent the slightest idea of how I would go about adding content to these specific regions programatically? I know I can create a custom block and place it in a region via the UI, but I am trying to add content to these regions via code.

Any advice would be greatly appreciated <3

How to add .html.twig template based on my websites installed theme.

Hello friends,

I have installed a theme to my Drupal 8 website, now I would like to create .html.twig templates in a custom module that is based off this theme.

inside the theme folder, there is a templates folder with two files: page--front.html.twig page.html.twig, page.html.twig looks as follows: 

Post 8.6.8 update issue -- Argument 1 passed to Drupal\Core\Extension\ExtensionList::Drupal\Core\Extension\{closure}() must be a

I updated sites today via composer, which updated them to 8.6.8. After completing the update, I noticed that the Admin screens looked "different". At first, I just chalked it up to a change in the update, however returning to work on a site, I got the "The website encountered an unexpected error. Please try again later." I checked my log and found the following:

Pages

Subscribe with RSS Subscribe to RSS - Drupal 8.x