Skip to content

Instantly share code, notes, and snippets.

View hemangigokhale's full-sized avatar
🎯
Focusing

hemangigokhale

🎯
Focusing
View GitHub Profile
@hemangigokhale
hemangigokhale / mymodule.module.php
Last active July 26, 2017 11:14
Drupal 8 Hide Blocks on the basis on URL Query Parameter
<?php
use Drupal\Core\Session\AccountInterface;
use Drupal\block\Entity\Block;
use Drupal\Component\Utility\UrlHelper;
use Drupal\Core\Access\AccessResult;
/**
* Implements hook_block_access().
*/
@hemangigokhale
hemangigokhale / mytheme.theme.php
Last active July 24, 2017 10:48
Showing X - Y of Z results in Drupal Core Search
<?php
/**
* Implements template_preprocess_item_list__search_results().
*/
function mytheme_preprocess_item_list__search_results(&$variables) {
global $pager_page_array, $pager_total_items, $pager_total;
$itemsPerPage = 6;
// Determine which page is being viewed
@hemangigokhale
hemangigokhale / views-exposed-form-search-page-search-page.php
Created July 24, 2017 06:53
8 Drupal Views Exposed Form in Search Form Format
<?php
switch ($form['#id']) {
case 'views-exposed-form-search-page-search-page':
$form['actions']['#attributes']['class'][] = 'input-group-btn';
$form['actions']['submit']['#attributes']['class'][] = 'icon glyphicon glyphicon-search';
$form['actions']['submit']['#value'] = '';
$form['keys']['#attributes']['data-toggle'] = 'tooltip';
$form['keys']['#attributes']['placeholder'] = 'Search in Blogs';
$form['keys']['#attributes']['title'] = 'Search in Blogs';
@hemangigokhale
hemangigokhale / Socialfeed-Instagram.md
Created July 11, 2017 18:04
Instagram Application Registration

Instagram

To be able to use and search after hash images on Instagram, you'll need a Client ID. This simple guide will step by step tell you have to get one.

You'll need to have an Instagram account to be able to get the Client ID.

Register Your Application

Follow these simple steps to get your own key.