Tuesday, April 24, 2018

Fetch image url in twig views block template in Drupal 8

-- Use pro_img variable anywhere in your current twig file --
=============================================
{% for row in rows %}
{% set pro_img = file_url(row['content']['#row']._entity.field_profile_picture.entity.fileuri) %}
{% endfor %}
-- Happy Coding

Tuesday, April 3, 2018

Detect MacBook by JavaScript

var isMac = navigator.platform.toUpperCase().indexOf('MAC')>=0;
 
  if ( isMac === true ) {
      $('css selector').css("line-height","150px");
  }

Switch PHP version in Ubuntu OS or Zorin OS

First check where is installed your PHP by the below command: $ which php See PHP version by below command: $ php -v As I've installed P...