Skip to main content

Posts

Input button missing primary class name

  Input button missing btn-primary class name in bootstrap_barrio theme Solution:  1. Goto Appearances > Settings  2. Just Save the settings form without changing anything. Article link: https://www.drupal.org/project/bootstrap_barrio/issues/3332673
Recent posts

gnutls_handshake() failed GIT Clone [Solution]

If you are facing error like "curl 56 GnuTLS recv error" while cloning a git repository, it is a "gnutls_handshake()" error. Error: RPC failed; curl 56 GnuTLS recv error (-24): Decryption has failed   Solution Rebuilding git with openssl Follow the steps given below: 1. Install build-essential, fakeroot and dpkg-dev using the following command. sudo apt-get install build-essential fakeroot dpkg-dev 2. Create a directory named git-rectify in the home folder using the following command. mkdir ~/git-rectify 3. CD in to the get-rectify directory and get the git source files. cd ~/git-rectify apt-get source git 4. Install all the git dependencies. sudo apt-get build-dep git 5. Install libcurl with all development files. sudo apt-get install libcurl4-openssl-dev   6. Unpack all the source packages using the following command. Note: The name “git_2.34.1-1ubuntu1.9” could vary based on the lastest version. So look in to the directory for the correct version name. dpkg-sourc

Main menu dropdown parent item clickable in Drupal 8 using Bootstrap 4

 Edit menu--main.html.twig template file {# /**  * @file  * Bootstrap Barrio's override to display a menu.  *  * Available variables:  * - menu_name: The machine name of the menu.  * - items: A nested list of menu items. Each menu item contains:  *   - attributes: HTML attributes for the menu item.  *   - below: The menu item child items.  *   - title: The menu link title.  *   - url: The menu link url, instance of \Drupal\Core\Url  *   - localized_options: Menu link localized options.  *   - is_expanded: TRUE if the link has visible children within the current  *     menu tree.  *   - is_collapsed: TRUE if the link has children within the current menu tree  *     that are not currently visible.  *   - in_active_trail: TRUE if the link is in the active trail.  */ #} {% import _self as menus %} {#   We call a macro which calls itself to render the full tree.   @see http://twig.sensiolabs.org/doc/tags/macro.html #} {{ menus.menu_links(items, attributes, 0) }} {% macro menu_links(item

Responsive CSS Breakpopints

/*   ##Device = Desktops   ##Screen = 1281px to higher resolution desktops */ @media (min-width: 1281px) {   //CSS } /*   ##Device = Laptops, Desktops   ##Screen = B/w 1025px to 1280px */ @media (min-width: 1025px) and (max-width: 1280px) {   //CSS } /*   ##Device = Tablets, Ipads (portrait)   ##Screen = B/w 768px to 1024px */ @media (min-width: 768px) and (max-width: 1024px) {   //CSS } /*   ##Device = Tablets, Ipads (landscape)   ##Screen = B/w 768px to 1024px */ @media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {   //CSS } /*   ##Device = Low Resolution Tablets, Mobiles (Landscape)   ##Screen = B/w 481px to 767px */ @media (min-width: 481px) and (max-width: 767px) {   //CSS } /*   ##Device = Most of the Smartphones Mobiles (Portrait)   ##Screen = B/w 320px to 479px */ @media (min-width: 320px) and (max-width: 480px) {     //CSS   }

Theme table with pager - Drupal 8

public function nodeList() {     $header = [       'Nid',       'Title',     ];     $query = \Drupal::database()->select('node', 'n');     $query->fields('n', ['nid']);     $pager = $query->extend('Drupal\Core\Database\Query\PagerSelectExtender')->limit(10);     $results = $pager->execute()->fetchAll();     foreach ($results as $key => $result) {       $node = Node::load($result->nid);       $row = [];       $row = [         'nid' => $node->id(),         'title' => $node->getTitle(),       ];       $rows[] = $row;     }     $build['table_data'] = [       '#type' => 'table',       '#header' => $header,       '#rows' => $rows,     ];     // Finally add the pager.     $build['pager'] = array(       '#type' => 'pager'     );     return $build;   }

Docksal usage with Drupal

DOCKSAL ======= 1. Drupal installation using composer ref: https://blog.docksal.io/creating-drupal-8-project-from-scratch-using-pre-installed-composer-in-docksal-cli-bfe49b0042e2 # Create new directory for the project mkdir my-new-project # Go to my new dir cd my-new-project # Download Drupal 8 using composer repo recommended in Drupal docs fin run-cli composer create-project drupal-composer/drupal-project:8.x-dev . --stability dev --no-interaction # Initialize Docksal project root mkdir .docksal # Configure DOCROOT to match checked out files fin config set DOCROOT=web # Start my project containers fin project start 2. To start existing project on Docksal   fin project start / fin up 3. DB settings (default)    db name: default    username: user    password: user    host: db 4. Install PHPMyAdmin to project   fin addon install pma   # Then access it like http://pma.project-name.docksal   # To install any addon (ref https://docs.docksal.io/fin/addons