This assumes you are using a Drupal 8 or Drupal 9 recipe and Mac OS. Also, xdebug 3.x is assumed, which is standard for Lando-provided PHP image.
Example .lando.yml
file can look like this:
name: xdebug-test
recipe: drupal8
config:
webroot: web
// open your javascript console and paste this | |
copy([...$('[role="grid"]')[Object.keys($('[role="grid"]')).filter(x => x.startsWith('__reactProps'))[0]].children[0].props.values[0][1].collection].filter(x => x.value.audio_url).map(x => x.value.audio_url).join(' ')) | |
// now you have a list of mp3 urls directly in your clipboard that you can pass to wget or a url downloader |
<?php | |
use Drupal\paragraphs\Entity\Paragraph; | |
/** | |
* Implements template_preprocess_node | |
* | |
* Add variables for paragraphs available to node templates | |
*/ | |
function CUSTOM_preprocess_node(&$variables) { | |
// Convenience Variables |
{% for item in items %} | |
{{ item.content }} | |
{% endfor %} |
var gulp = require('gulp'), | |
sass = require('gulp-ruby-sass'), | |
spritesmith = require('gulp.spritesmith'), | |
compass = require('gulp-compass'), | |
path = require('path'), | |
minifyCss = require('gulp-minify-css'), | |
browserSync = require('browser-sync'), | |
tinypng = require('gulp-tinypng'), | |
autoprefixer = require('gulp-autoprefixer'), | |
plumber = require('gulp-plumber'); |
<script type="text/javascript"> | |
function loadGalleryDeepLink() | |
{ | |
var prefix = "#gallery-"; | |
var h = location.hash; | |
if (document.g_magnific_hash_loaded === undefined && h.indexOf(prefix) === 0) |
// ----------- | |
// Debugger that shows view port size. Helps when making responsive designs. | |
// ----------- | |
function showViewPortSize(display) { | |
if(display) { | |
var height = jQuery(window).height(); | |
var width = jQuery(window).width(); | |
jQuery('body').prepend('<div id="viewportsize" style="z-index:9999;position:fixed;top:40px;left:5px;color:#fff;background:#000;padding:10px">Height: '+height+'<br>Width: '+width+'</div>'); | |
jQuery(window).resize(function() { |
function urlFromHash() { | |
if (location.hash.substr(0, 2) != '#!') { | |
return null; | |
} | |
// why not location.hash? => http://stackoverflow.com/q/4835784/298479 | |
return location.href.split('#')[1].substr(1); | |
} | |
$('#gallery').magnificPopup({ | |
type: 'image', |
<?php | |
function NAMEOFTHEME_preprocess_page(&$vars) { | |
// Use grouped import technique for more than 30 un-aggregated stylesheets (css limit fix for IE) | |
$css = drupal_add_css(); | |
if (NAMEOFTHEME_css_count($css) > 26) { | |
$styles = ''; | |
$suffix = "\n".'</style>'."\n"; | |
foreach ($css as $media => $types) { | |
$prefix = '<style type="text/css" media="'. $media .'">'."\n"; |