Skip to content

Instantly share code, notes, and snippets.

@ummdorian
ummdorian / index.php
Created Mar 28, 2018
Drupal 8 Query Alter Group By (views)
View index.php
<?php
function module_query_views_events_alter(Drupal\Core\Database\Query\AlterableInterface $query){
// If this the right query
if(
$query->getMetaData('view') != ''
&& $query->getMetaData('view')->getDisplay()->display['id'] == 'block_3'
){
@Mulkave
Mulkave / drupal-nginx-virtualhost.conf
Created Jul 29, 2013
drupal virtual host configuration for Nginx
View drupal-nginx-virtualhost.conf
server {
server_name [host];
root /var/www/[document_root]; ## <-- Your only path reference.
# Enable compression, this will help if you have for instance advagg module
# by serving Gzip versions of the files.
gzip_static on;
location = /favicon.ico {
@robdecker
robdecker / script.js
Last active Aug 7, 2020
[Embed YouTube & Vimeo videos in a Colorbox popup] Requires http://www.jacklmoore.com/colorbox/ #js
View script.js
(function ($) {
$("#content a[href*='vimeo.com']").each(function() {
$this = $(this);
var href = $this.attr('href');
var vimeoId = href.split('/').pop();
$this.colorbox({ html: function() {
var iframe = '<iframe width="853" height="480" src="http://player.vimeo.com/video/' + vimeoId + '?autoplay=1" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';
var output = "<div style='line-height: 0px; overflow: hidden;'>" + iframe + '</div>';
return output;
}});
You can’t perform that action at this time.