I assume you're using Drupal 8 recipe and Linux as a host 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 |
#Lando file for angular app + storybook | |
name: angular-app | |
excludes: | |
- ./node_modules | |
proxy: | |
front: | |
- angular-app.lndo.site:4200 | |
- storybook-app.lndo.site:6006 | |
services: | |
front: |
name: myproject | |
recipe: laravel | |
config: | |
php: '8.1' | |
via: nginx | |
database: mysql:5.7 | |
webroot: public | |
xdebug: true | |
services: | |
appserver: |
function HOOK_preprocess_block__page_title_block(&$variables) { | |
$request = \Drupal::request(); | |
$route_match = \Drupal::routeMatch(); | |
$page_title = \Drupal::service('title_resolver')->getTitle($request, $route_match->getRouteObject()); | |
if (!empty($page_title) && empty($variables['content']['#title'])) { | |
$variables['content']['#title'] = $page_title; | |
} | |
} |
<?php | |
/** | |
* Implements hook_metatags_attachments_alter(). | |
* | |
* This function allows you to define fallback tokens in case a field is empty. | |
* | |
* If all fallback values are empty, the tag will be empty. | |
* | |
* Example: [node:field_image:medium]||[node:field_legacy_image:medium]||/fallback.png |
// Requires Gulp v4. | |
// $ npm uninstall --global gulp gulp-cli | |
// $ rm /usr/local/share/man/man1/gulp.1 | |
// $ npm install --global gulp-cli | |
// $ npm install | |
const { src, dest, watch, series, parallel } = require('gulp'); | |
const browsersync = require('browser-sync').create(); | |
const sass = require('gulp-sass'); | |
const autoprefixer = require('gulp-autoprefixer'); | |
const sourcemaps = require('gulp-sourcemaps'); |
{# | |
This snippet is from a component based (Emulsify / Pattern Lab) custom Drupal theme. | |
The "span_…" variables are the properties of the BEM Twig function. | |
See: https://www.fourkitchens.com/blog/development/bem-twig-function/ | |
The goal is to set the default display correctly (when the page loads). | |
After that the field visibility is manipulated by JS based on user interaction. | |
#} | |
{% set amount = element['#object'].field_amount.value %} |
app.pageSliders = { | |
slider: null, | |
container: ".tiny-slider", | |
init: function() { | |
// no reason to continue init if no slider on page | |
if (!document.querySelector("#mainslider")) { | |
return; | |
} | |
app.pageSliders.slider = tns({ |